Example
Execute a paragraph when the mouse button is pressed on the paragraphJavaScript:
<p onmousedown="mouseDown()">请点击此文本!</p>
Browser support
IE
Firefox
Chrome
Safari
Opera
All major browsers support the onmousedown attribute.
Definition and Usage
The onmousedown attribute is triggered when the mouse button is pressed on the element.
Tips: Event order relative to onmousedown event (limited to left/middle mouse button):
Event order relative to the onmousedown event (limited to the right mouse button):
onmousedown onmouseup oncontextmenu
Note: The onmousedown attribute does not apply to the following elements:
,