Execute a JavaScript when pressing a mouse button over a paragraph:
The onmousedown attribute fires when a mouse button is pressed down on the element.
Tip: The order of events related to the onmousedown event (for the left/middle mouse button):
The order of events related to the onmousedown event (for the right mouse button):
Event Attribute | |||||
---|---|---|---|---|---|
onmousedown | Yes | Yes | Yes | Yes | Yes |
None.
Value | Description |
---|---|
script | The script to be run on onmousedown |
Supported HTML tags: | All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> |
---|
HTML DOM reference: onmousedown event