ondblclick Event

Definition and Usage

The ondblclick event occurs when the user double-clicks an element.

Example

Execute JavaScript when double-clicking the <p> element:

<p ondblclick="myFunction()">Double-click me</p>

Try It Yourself

Syntax

In HTML:

<element ondblclick="myScript">

Try It Yourself

In JavaScript:

object.ondblclick = function(){myScript};

Try It Yourself

In JavaScript, use the addEventListener() method:

object.addEventListener("dblclick", myScript);

Try It Yourself

Note:Internet Explorer 8 and earlier versions do not support addEventListener() Method.

Technical Details

Bubbling: Support
Cancellable: Support
Event types: MouseEvent
Supported HTML tags: All HTML elements except: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style> and <title>.
DOM Version: Level 2 Events

Browser Support

Events Chrome IE Firefox Safari Opera
ondblclick Support Support Support Support Support

Related Pages

HTML DOM Reference Manual:onclick Event

HTML DOM Reference Manual:onmousedown Event

HTML DOM Reference Manual:onmouseup Event