ondblclick event

Definition and usage

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

Example

Execute JavaScript when the <p> element is double-clicked:

<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 or 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 understøttelse

Begivenheder Chrome IE Firefox Safari Opera
ondblclick Support Support Support Support Support

Relaterede sider

HTML DOM referencehåndbog:onclick begivenhed

HTML DOM referencehåndbog:onmousedown begivenhed

HTML DOM referencehåndbog:onmouseup begivenhed