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

后端 未结 6 775
死守一世寂寞
死守一世寂寞 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条回答
  •  -上瘾入骨i
    2020-12-08 08:37

    Note that in newer browsers you'll be able to use the new HTML5 "input" event (https://developer.mozilla.org/en-US/docs/DOM/window.oninput) for this. Most non-IE browsers have supported this event for a long time (see compatibility table in the link); for IE it's version >/9 only unfortunately.

提交回复
热议问题