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 mainstream 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 runs when ondblclick occurs.