English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de Referência HTML

大全 de etiquetas HTML

Propriedade de evento ondblclick do HTML

A propriedade ondblclick é usada para obter ou definir a função de manipulador de eventos do evento dblclick do elemento atual

HTML event attributes

Exemplo Online

Clique duas vezes no botão esquerdo do mouse no elemento atual para acionar o evento dblclick:

!DOCTYPE html>
<html>
<head>
<title>Exemplo de ondblclick Demonstração Tutorial Básicooldtoolbag.com</title>
</head>
<body>
<script>
function showAlert()
 {
 alert("Detected dblclick event!")
 }
</script>
<button ondblclick="showAlert()">Clique com o botão esquerdo do mouse duas vezes em mim</button>
<p>Double-clicking the element above will trigger the dblclick event.</p>
</body>
</html>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the ondblclick event attribute

Definition and usage

The ondblclick attribute is triggered when the mouse double-clicks on an element.

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

HTML 4.01 and HTML5The differences between

None.

Syntax

<element ondblclick="script">

Attribute value

ValueDescription
scriptSpecifies the script to be executed when the ondblclick event is triggered.
HTML event attributes