<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{
margin: 0;
padding: 0;
}
#box{
width: 100px;
height: 100px;
background: #000;
margin-top: 100px;
margin-left: 20px;
}
</style>
</head>
<body>
<div id="box"></div>
<script>
var oBox=document.getElementById('box');
oBox.onclick=function(e){
console.log(e);
}
//clientX
//clinetY
//pageX
//pageY
//offsetX
//offsetY
//target
//type
</script>
</body>
</html>
复制代码
DOM2级事件对象(e)
最新推荐文章于 2024-03-14 14:19:28 发布