开发者

Cancel the keydown in an HTML page?

How can I cancel the keydown of a button on the keyboard in an HTML开发者_开发技巧 page.

Thanks


It's somewhat more complicated than described so far, see Quirksmode.org:

You cannot prevent the default onkeydown in Opera.

In Opera, use onkeypress instead.


Handle the onkeydown event and return false;


Try this

<input type="button" onkeydown="return false;" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜