<!DOCTYPEhtml>
<html>
var obj= {};
Object.defineProperty(obj,'txt',{
get:function(){
returnobj
},
set:function(newValue){
document.getElementById('txt').value= newValue;
document.getElementById('show').innerHTML= newValue;
}
})
document.addEventListener('keyup',function(e){
obj.txt= e.target.value
})
</script>
</html>