HTML ondblclick event attribute

Example

Execute a JavaScript block when the mouse button is double-clicked:

<button ondblclick="copyText()">Copy Text</button>

Try it yourself

Browser support

IE Firefox Chrome Safari Opera

All major browsers support the ondblclick attribute.

Definition and usage

The ondblclick attribute triggers when the mouse double-clicks on an element.

Note:The ondblclick attribute is not applicable to the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style> or <title>.

Differences between HTML 4.01 and HTML5

None.

Syntax

<element ondblclick="script">

Attribute value

Value Description
script Script executed when ondblclick occurs.