1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<!DOCTYPE html> <html>
<head> <meta charset="UTF-8"> <title>e</title> </head>
<body> <input type="button" value="按钮" id="inp"> </body>
</html> <script> var inp = document.getElementById('inp')
function fun(e) { console.log('e:' + e) console.log('typeof e:' + typeof e) console.log('e.type:' + e.type) console.log('fun.arguments.length:' + fun.arguments.length) console.log('e.target:' + e.target) console.log('e.target.tagName:' + e.target.tagName) console.log('e.clientX:' + e.clientX) //窗口 console.log('e.clientY:' + e.clientY) console.log('e.screenX:' + e.screenX) //屏幕 console.log('e.screenY:' + e.screenY) } //document.onclick = fun inp.onclick = fun </script>
|
近期评论