onfocus在火狐、ie10浏览器失效解决方法方法


<script> 
    function setit(){ 
    if(document.all){ 
    document.getElementById("myframe").attachEvent("onfocus",dothis); 
    }else{ 
    document.getElementById("myframe").contentWindow.addEventListener("onfocus",dothis,false); 
    } 
    } 
    
function dothis(){ 
alert("blurred"); 

</script> 
<body onload="setit()"> 
<input /> 
</body> 

posted on 2013-11-26 14:47  Lei1990  阅读(218)  评论(0编辑  收藏  举报

导航