lyuehh
10/18/2012 - 6:44 AM

click a input in ie

click a input in ie

 
<!--demo from : http://www.cnblogs.com/rubylouvre/archive/2012/10/18/2729388.html -->
<!DOCTYPE HTML>
<html>
    <head>
        <title>onbeforeactivate by 司徒正美</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script>
       
            window.onload = function(){
                function callback(e) { 
                    console.log(e.type) 
                } 
                var a = document.getElementById("test")
                a.attachEvent('onbeforeactivate', callback); 
                a.attachEvent('onactivate', callback); 
                a.attachEvent('onfocusin', callback); 
                a.attachEvent('onfocus', callback); 

                a.attachEvent('onmousedown', callback); 
                a.attachEvent('onmouseup', callback); 
                a.attachEvent('onclick', callback); 
            }
        </script>
    </head>
    <body>
        <input id="test" value="点我"/>
    </body>
</html>



<!--
日志: mousedown 
日志: beforeactivate 
日志: activate 
日志: focusin 
日志: focus 
日志: mouseup 
日志: click
-->