HTML onmousedown Attribute

❮ HTML 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


Applies to:

The onmousedown attribute can be used on the following element:

Element Attribute
All HTML elements. onmousedown

Attribute Values

Value Description
script Specifies the script to be run on onmousedown
❮ HTML Attributes