兼容ie和火狐禁用tab键js
兼容ie和火狐禁用tab键js
<!--禁用tab键,避免bug--> <script type="text/javascript"> document.onkeydown=function(e){ var isie = (document.all) ? true:false; var key; var ev; if(isie){//IE浏览器 key = window.event.keyCode; ev = window.event; }else{//火狐浏览器 key = e.which; ev = e; } if(key==9){//IE浏览器 if(isie){ ev.keyCode=0; ev.returnValue=false; }else{//火狐浏览器 ev.which=0; ev.preventDefault(); } } }; </script>
相关推荐
jjddrushi 2019-12-27
baynkbtg 2017-05-24
80437916 2020-04-11
WinerChopin 2020-03-03
程序员俱乐部 2020-02-21
cfang00 2013-05-15
流年浅滩 2015-06-14
MaureenChen 2014-05-28
囧芝麻 2019-12-28
Safari浏览器 2019-12-23
Safari浏览器 2019-12-11
letheashura 2019-12-03
宇智波鼬 2014-01-20
89357940 2014-01-14
Teresasmida 2014-01-10
Congpanpan 2013-09-04