onmousedown Event in JavaScript
onmousedown Event in JavaScript
The onmousedown event is used to fire when a mouse button is pressed down on the element. It is applicable to all HTML elements.
Events relative to onmousedown are:-
- onmousedown
- onmouseup
- oncontextmenu
Syntax:-
Its syntax is:- < anyElement onmousedown="my_script" > OR object.onmousedown= function(){my_script} OR object.addEventListener("mousedown", my_script)