ondblclickEvent

事件对象参考手册Event Object

Example

Execute JavaScript code when an element is double-clicked:

<p ondblclick="myFunction()">Click me</p>

Try it yourself »

Definition and Usage

The ondblclick event occurs when an object is double-clicked.

Syntax

In HTML:

<element ondblclick="SomeJavaScriptCode">

In JavaScript:

object.ondblclick=function(){SomeJavaScriptCode};

Parameters Description
SomeJavaScriptCode Required. Specifies the JavaScript to execute when the event occurs.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the ondblclick event


HTML tags that support this event:

The ondblclick attribute can be used on all HTML elements, except: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.


事件对象参考手册Event Object Other Extensions