English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The dblclick() method triggers the dblclick event, or attach a function to be executed when the dblclick event occurs.
When a user double-clicks an element, a dblclick event occurs.
Trigger the dblclick event of the selected element:
$(selector).dblclick()
Attach the function to the dblclick event:
$(selector).dblclick(function)
Trigger the dblclick event of the <p> element:
$(document).ready(function(){ $("p").dblclick(); });Test to see‹/›
Attach the function to the dblclick event (the dblclick event occurs when the user double-clicks an element):
$("p").dblclick(function(){ $(this).css({"background-"color":"#007FFF","color":"white"}); });Test to see‹/›
Hide the paragraph on the page when double-clicked:
$("p").dblclick(function(){ $(this).slideUp(); });Test to see‹/›
Parameters | Description |
---|---|
function | Function executed when the dblclick event is triggered each time |