This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.



Fires when the user clicks the object with either mouse button or taps the mouse pad.

Overview Table

Synchronous No
Bubbles Yes
Target dom/Element
Cancelable Yes
Default action ?
## Examples

This example shows how to determine the origin of the onmousedown event when event bubbling is used.

<body onmousedown="(;">
<table style="table-layout:fixed; cell-collapse:collapse">
  <th>Click the items below with your mouse.</th>
  <tr><td><button type="button">Click Me</button></td></tr>
  <tr><td><input type="text" value="Click Me"/></td></tr>
  <tr><td>Click Me</td></tr>
<p>This code retrieves the tagName of the object on which
   the onmousedown event has fired.</p>

View live example


 Determine the properties of the DOM element that a user clicks on.



Use the button property to determine which mouse button is clicked. Initiates actions associated with the event and with the object being clicked. To invoke this event, do one of the following:

  • Click a mouse button.


Standards information

Event handler parameters

pEvtObj [in]
Type: ****IHTMLEventObj****