Detecting “value” of input text field after a keydown event in the text field?

后端 未结 6 795
死守一世寂寞
死守一世寂寞 2020-12-08 08:04

So my site has an input box, which has a onkeydown event that merely alerts the value of the input box.

Unfortunately the value of the input does not include the ch

6条回答
  •  渐次进展
    2020-12-08 08:47

    keyup/down events are handled differently in different browsers. The simple solution is to use a library like mootools, which will make them behave the same, deal with propagation and bubbling, and give you a standard "this" in the callback.

提交回复
热议问题