Fires when the user moves the mouse over the object.
Overview Table Synchronous No Bubbles Yes Target dom/Element Cancelable No Default action none## Examples
This example uses the onmousemove event to monitor the location of the mouse cursor on the screen. When the mouse cursor moves over the div object, a span object is updated with the clientX and clientY property values. The clientX and clientY properties are exposed by the event object.
<script type="text/javascript">
function fnTrackMouse(){
oNotice.innerText="Coords: (" + event.clientX + ",
" + event.clientY + ")";
}
</script>
<div id="oScratch" onmousemove="fnTrackMouse()">
<span id="oNotice"></span>
</div>
Add mouse crosshairs to a web page when a checkbox is clicked.
function moveCrosshairs(evt){
if(!evt)evt=window.event;
var posx = 0; var posy = 0;
if(document.documentMode&&document.documentMode>=9){
posx+=parseInt(document.documentElement.style.marginLeft+0);
posy+=parseInt(document.documentElement.style.marginTop+0);
}
if (evt.pageX
Notes Remarks
If the user presses a mouse button, use the button property to determine which button was pressed. Initiates any action associated with this event. To invoke this event, do one of the following:
Mozilla Developer Network : [mousemove event Article]
Microsoft Developer Network: [mousemove event Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4