Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML onmousedown Event Attribute

HTML onmousedown Event Attribute

HTML Event Attributes HTML Event Attributes

Example

Run a script when a mouse button is pressed:

Click the text!

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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):

  1. onmousedown
  2. onmouseup
  3. onclick

The event firing order related to the onmousedown event (right mouse button):

  1. onmousedown
  2. onmouseup
  3. oncontextmenu

Note: The onmousedown attribute cannot be used with the following elements: , ,
, , ,