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: Unterstützung
Cancellable: Unterstützung
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-Unterstützung

Ereignisse Chrome IE Firefox Safari Opera
ondblclick Unterstützung Unterstützung Unterstützung Unterstützung Unterstützung

Verwandte Seiten

HTML DOM Referenzhandbuch:onclick-Ereignis

HTML DOM Referenzhandbuch:onmousedown-Ereignis

HTML DOM Referenzhandbuch:onmouseup-Ereignis