MouseEvent offsetX Property in JavaScript
MouseEvent offsetX Property in JavaScript
The offsetX property is a read-only property and it is used to return x-coordinate of the mouse pointer relative to the target element. For getting the y-coordinate, we use the offsetY property.
Syntax:-
Its syntax is:- event.offsetX
Return:-
Its return is:- number denoting horizontal coordinate of mouse pointer in pixels