The MouseEvent screenY property is a read-only property and used for returning the vertical coordinate of the mouse pointer when an event was triggered.
Return Value: It returns a number which represents the vertical coordinate of the mouse pointer in pixels.
Below program illustrates the MouseEvent screenY property:
Example: Finding out the horizontal coordinates of the mouse pointer, relative to the screen, when the mouse button is clicked on an element.
- Before clicking the button:
- After clicking the button:
- Internet Explorer
- Google Chrome
- Apple Safari