mousedown
Summary
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 | ? |
This example shows how to determine the origin of the onmousedown event when event bubbling is used.
<body onmousedown="(event.target)?alert(event.target.tagName):alert(event.srcElement.tagName);">
<table style="table-layout:fixed; cell-collapse:collapse">
<tr>
<th>Click the items below with your mouse.</th>
</tr>
<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>
</table>
<p>This code retrieves the tagName of the object on which
the onmousedown event has fired.</p>
</body>
Usage
Determine the properties of the DOM element that a user clicks on.
Notes
Remarks
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.
Syntax
Standards information
- HTML 4.01 Specification, Section 18.2.3
Event handler parameters
- pEvtObj [in]
- Type: ****IHTMLEventObj****
Attributions
Mozilla Developer Network : [mousedown Article]
Microsoft Developer Network: [event.mousedown Article]