dblclick() Method - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:dblclick

jQuery dblclick() Event

Description

The dblclick() method triggers the dblclick event, or sets function as dblclick event handler.

Syntax

$(selector).dblclick(function);
Parameter Description
function Optional. Specifies the function to run when the dblclick event occurs

The following code shows how to handle Double-click event on a <p> element.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("p").dblclick(function(){
        console.log("The paragraph was double-clicked.");
    });//w w w . j  av  a 2  s.com
});
</script>
</head>
<body>

<p>Double-click on this paragraph.</p>

</body>
</html>

Related Tutorials