[問題] js onmousedown只能使用一次
寫了一個點一下滑鼠就可以在螢幕顯示座標的函式
程式長這樣
function mouseDown(theEvent)
{
var theEvent = theEvent ? theEvent : window.event;
var locString = "X = " + theEvent.screenX + " Y = " + theEvent.screenY;
document.write(locString);
}
但不論我用
document.onclick=mouseDown;
或者
<body onclick="mouseDown();">
只有點第一下可以正常運作
第二下就毫無反應了
請問這樣是什麼原因造成的?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.205.57
推
03/13 18:13, , 1F
03/13 18:13, 1F
→
03/13 18:44, , 2F
03/13 18:44, 2F
→
03/13 21:29, , 3F
03/13 21:29, 3F
→
03/14 14:12, , 4F
03/14 14:12, 4F
推
03/15 19:50, , 5F
03/15 19:50, 5F