<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title> window.event应用</title>
<script>
function body_onclick(){
alert("鼠标点击的坐标是\r\nx:"+event.y+", y:"+event.y);
}
</script>
</head>
<body style="overflow:auto; padding:0px; margin:0px;" onclick="body_onclick();">
</body>
</html>
本文演示如何在网页中通过JavaScript监听鼠标点击事件,并获取点击的坐标位置。
1173

被折叠的 条评论
为什么被折叠?



