html <input type=“text” /> onchange event not working

后端 未结 12 2526
-上瘾入骨i
-上瘾入骨i 2020-11-30 01:13

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

12条回答
  •  無奈伤痛
    2020-11-30 01:23

    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); }

提交回复
热议问题