<input type='text' onchange="reportAnswer(1, this.value);"
onkeyup="this.onchange();" onpaste="this.onchange();"
oncut="this.onchange();"
onclear = "this.onchange();" />
如何捕捉这种变化?这是 IE11。
附言我添加了 onclear
处理程序,因为我不知道该怎么做。
最佳答案
你还没有说是什么提供了 [x]
,这可能是相关的,但是你还没有尝试过的一个事件是 input
所以:Live Example
<input type='text'
onchange="reportAnswer(1, this.value);"
onkeyup="this.onchange();"
onpaste="this.onchange();"
oncut="this.onchange();"
oninput="this.onchange();" />
(不知道它是否有效,IE11 不会在 Windows 8.1 上为我添加该框。)
不过,更有可能的是,您需要连接到由提供 [x]
的任何东西提供的东西。
关于javascript - 如何捕获输入的类型 = 'text' 清除事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25848640/