<script>
function tt()
{
document.all.a.value = event.x;
if(event.x < 10)alert("alert")
}
</script>
<body onmousemove = tt();>
<input type="text" name="a">
</body>
function tt()
{
document.all.a.value = event.x;
if(event.x < 10)alert("alert")
}
</script>
<body onmousemove = tt();>
<input type="text" name="a">
</body>
var Y = window.event.y; //鼠标位置相对于页面的y坐标