onmousemove events In Java Script

This event occurs when the user moves mouse. The x and y coordinates of the mouse pointer are trapped and when the position changes any of x or y this event fires. We can program the change of position of mouse on the web page using this event.


<title>events </title>


<body bgcolor=green text=yellow onmousemove=”ff()”>

<h4 align =center> Please move the mouse </h4>


The X axis and Y axis position of Cursor on screen will be displayed in textbox


name : <input type=”text” name=”t1″ onkeydown=”ff()”>


function ff()


t1.value=”” t1.value=”X : “+event.screenX + ” Y :”+event.screenY





Scroll to Top