HTML ondblclick Event Attribute HTML Reference


Execute a JavaScript when a button is double-clicked:

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

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

1. Definition and Usage

The ondblclick attribute fires on a mouse double-click on the element.

Note: The ondblclick attribute CANNOT be used with: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, or <title>.

2. Differences Between HTML 4.01 and HTML5


3. Syntax

<element ondblclick="script">

4. Attribute Values

Value Description
script The script to be run on ondblclick

Relative articles