HTML » HTML Core Attributes » ondblclick

Version: 4.0

Syntax:
ondblclick="action"

The ondblclick core attribute is an event handler that is associated with the double click of a mouse on a selected HTML tag (element). Whenever you double click the element, the script code of the ondblclick is executed. This script can also call functions or subroutines which contain code that you want to run when the double click occurs.

The similar onclick core attribute is an event handler that is associated with the single click of a mouse.

Examples

Code:
<input type="button" ondblclick="JavaScript: alert( 'ondblclick event' )" value="Double Click Me!">
Output:
Explanation:

In this example, every time you double click the button element, one line of JavaScript code is executed which causes an alert box to be displayed with a message.

Language(s): HTML

See Also: