dblclick
Summary
A mouse double click event.
Overview Table
Synchronous | No |
---|---|
Bubbles | No |
Target | dom/Element |
Cancelable | No |
Default action | ? |
This example uses the dblclick event to add items to a list box when the user double-clicks in the text box.
<!doctype html>
<html>
<head>
<script>
function addItem() {
sNewItem = new Option(txtEnter.value);
selList.add(sNewItem);
}
</script>
</head>
<body>
<p>Enter text and then double-click in the text box to add text to the list box.
<input type="text" name="txtEnter" value="Enter_text" ondblclick="addItem()">
<select name="selList" size="5"></select>
</body>
</html>
Notes
The order of events leading to the dblclick event is mousedown, mouseup, click, mouseup, and then dblclick. Actions associated with any of these events are executed when the dblclick event fires. Initiates any action that is associated with the event. To invoke this event, do one of the following:
- Click the left mouse button twice in rapid succession over an object. The user’s double-click must occur within the time limit specified by the user’s system.
Related specifications
- HTML 4.01
- Recommendation
- DOM Level 3 Events
- Working Draft
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]