ondblclick event | dblclick event
Occurs when the user double clicks on an element.
How to register:
In HTML:
In JavaScript:
<ELEMENT ondblclick="handler"> |
In JavaScript:
object.ondblclick = handler; | |||||||||||
object.addEventListener ("dblclick", handler, useCapture); |
| ||||||||||
object.attachEvent ("ondblclick", handler); |
You can find the related objects in the Supported by objects section below.
The event object is accessible to all event handlers in all browsers.
The properties of the event object contain additional information about the current event.
To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
For a complete list of events, see the page for Events in JavaScript. |
Basic information:
Bubbles | Yes |
Cancelable | Yes |
Event object | MouseEvent |
Actions that invoke the ondblclick event:
- Clicking on the left mouse button twice on the same element quickly without moving the mouse.
The order of events related to the ondblclick event:
Internet Explorer | Firefox, Opera, Google Chrome, Safari |
---|---|
|
|
Example HTML code 1:
This example illustrates the use of the ondblclick event:
|
||||
<head> <script type="text/javascript"> function OnDblClickSpan () { alert ("You have double-clicked on the text!"); } </script> </head> <body> <span ondblclick="OnDblClickSpan ()">Click on me twice and fast!</span> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
document, window
HTML elements:
a, abbr, acronym, address, applet, area, b, bdo, big, blink, blockquote, body, button, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, embed, fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, html, i, img, input:button, input:checkbox, input:file, input:image, input:password, input:radio, input:range, input:reset, input:search, input:submit, input:text, ins, isindex, kbd, keygen, label, legend, li, listing, map, marquee, menu, nobr, noframes, object, ol, optgroup, option, p, plaintext, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tr, tt, u, ul, var, xmp
Related pages:
External links:
ondblclick (MSDN)
ondblclick (Mozilla Developer Center)
ondblclick (Safari Reference Library)
ondblclick (W3C)
ondblclick (Mozilla Developer Center)
ondblclick (Safari Reference Library)
ondblclick (W3C)
User Contributed Comments