JavaScript Reference/Javascript Properties/pageX

Материал из Web эксперт
Перейти к: навигация, поиск

"pageX" Example

    
<html>
<body>
<script>
function function1(myEvent) { 
   document.getElementById("myX").innerHTML = myEvent.pageX;
   document.getElementById("myY").innerHTML = myEvent.pageY; 
} 
document.onmousemove = function1;
</script>
<p>
    <b>Page X Coordinate:</b> 
    <span id="myX">0</span>
</p>
<p>
    <b>Page Y Coordinate:</b> 
    <span id="myY">0</span>
</p>
</body>
</html>



"pageX" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |event                                                         |
+----------------+--------------------------------------------------------------+



"pageX" Syntax and Note

Note:
Read-only property. 
Set cursor X coordinate.
    
Syntax:
    
event.pageX
eventName.pageX