HTML ondblclickEvent Attribute

HTML 事件属性HTML Event Attributes

Examples

Run a script when the mouse is double-clicked

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

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the ondblclick event attribute.


Definition and Usage

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

Note:The ondblclick attribute cannot be used on the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, or <title>.


Difference between HTML 4.01 and HTML5

None.


Syntax

<element ondblclick="script">

Attribute Values

Value Description
script Specifies the script to be executed when the ondblclick event is triggered.


HTML 事件属性HTML Event Attributes Other Extensions