![]() |
VOOZH | about |
The onPointerDown event in React fires whenever the pointer (mouse) is down i.e. clicked over the tag or element over which the event has been applied. Similar to other events, we have to provide a function which executes the task or process when the event occurs.
onPointerMove={function}Parameter :
Return type:
Example 1 : In this example, we implemented an area where the user can click using the mouse and then accordingly displayed whether he/she has performed a left click, right click or middle button click using the "event.button" property of the onPointerDown event.
Output:
Example 2: In this example, we implemented an area where users can click using the mouse. Whenever the mouse click event occures the onPointerDown event gets fired and shows an alert for the same.
Output: