I am trying to do some experiment. What I want to happen is that everytime the user types in something in the textbox, it will be displayed in a dialog box. I used the
Firstly, what 'doesn't work'? Do you not see the alert?
Also, Your code could be simplified to this
function checkInput(obj) { alert(obj.value); }