To prevent the default action of a keypress in Opera, you need to do it in the keypress event. The following is adapted from my answer to this similar question:var cancelKeypress = false;document.onkeydown = function(evt) { evt = evt || window.event; cancelKeypress = /^(112|113)$/.test("" + evt.keyCode); if (cancelKeypress) { return false; }};/* For Opera */document.onkeypress = function(evt) { if (cancelKeypress) { return false; }}; 这篇关于禁用javascript中的Opera功能键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-08 04:06