兼容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>