HTML | DOM MouseEvent screenX Property
The MouseEvent screenX property is used for returning the horizontal coordinate of the mouse pointer whenever this event is triggered. It returns a number which represents the horizontal distance of the mouse pointer relative to the screen in pixels.
The MouseEvent screenX property is a read-only property and it returns a number which represents the horizontal coordinate of the mouse pointer in pixels.
Below program illustrate the MouseEvent screenX property :
Program: Finding out the horizontal coordinates of the mouse pointer, relative to the screen, when the mouse button is clicked on an element.
After clicking the button
Supported Web Browsers
- Internet Explorer
- Google Chrome
- Apple Safari
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.