我正在尝试通过JavaScript处理Windows Phone浏览器中的keypress
事件。这是工作示例:http://jsfiddle.net/alex_myronov/c5n4C/2/。但是,当我更改input
值时,不会触发处理程序。仅在inpu
失去焦点时才触发。
有人知道如何处理吗?
最佳答案
与keypress相比,尝试keydown事件,我相信keypress的实现不是一贯的。
<input data-bind="event: {keydown: changeStatus}, valueUpdate: 'afterkeydown'"></input>
有关两者之间区别的更多信息,请参见此处:
What's the difference between KeyDown and KeyPress in .NET?