标签:
<div id="mouse" style="width:300px;height:100px;border:1px solid #ccc"></div>
<div id="out"></div>
<script type="text/javascript">
var mouses = document.getElementById("mouse");
mouses.onmousemove = function(m){
var x = m.clientX;
var y = m.clientY;
document.getElementById("out").innerHTML = "坐标:("+x+","+y+")";
}
mouses.onmouseout = function(){
document.getElementById("out").innerHTML = "";
}
</script>
标签:
原文地址:http://www.cnblogs.com/hesuy/p/4239599.html