HTML onmousedown event Attribute

❮ HTML Event Attributes


<p onmousedown="myFunction()">Click me!</p>


The onmousedown attribute specifies the script run when a mouse button is pressed down on an element.

Standard Syntax

<element onmousedown="script">

Browser Support


Attribute Values

Value Description
script Specifies the script to be run on onmousedown

Technical Details

Supported HTML elements:

All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>
❮ HTML Event Attributes