Home  >  Article  >  Web Front-end  >  javascript禁用Tab键脚本实例_javascript技巧

javascript禁用Tab键脚本实例_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:13:091136browse

代码如下:

复制代码 代码如下:

    function HandleTabKey(evt) {
        if (evt.keyCode == 9) {
             if (evt.preventDefault) { evt.preventDefault(); }
            else { evt.returnValue = false; }
        }
    }

在IE 6、IE 7、IE 8、FireFox、Chrome中测试通过。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn