HTML onmousedown Event Attribute
Example
Run a script when a mouse button is pressed:
Click the text!
Try it »
Browser support





All major browsers support the onmousedown event attribute
Definition and Usage
The onmousedown attribute is triggered when a mouse button is pressed.
Tip: The event firing order related to the onmousedown event (left/middle mouse button):
- onmousedown
- onmouseup
- onclick
The event firing order related to the onmousedown event (right mouse button):
- onmousedown
- onmouseup
- oncontextmenu
Note: The onmousedown attribute cannot be used with the following elements:
, , ,
HTML Event Attributes