CSSOM视图模式x/y属性实例页面
回到相关文章 »代码:
HTML代码:
<button id="button1">点击弹出鼠标的x和y</button>
JS代码:
document.getElementById("button1").onclick = function(e) { var event = e || window.event; alert("x: " + event.x + ", \r\ny: " + event.y); };
<button id="button1">点击弹出鼠标的x和y</button>
document.getElementById("button1").onclick = function(e) { var event = e || window.event; alert("x: " + event.x + ", \r\ny: " + event.y); };