Attach a function to the dblclick event: - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:dblclick

Description

Attach a function to the dblclick event:

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(){
        $(this).fadeOut();//from ww  w.  j a  v  a 2  s .  c  o m
    });
});
</script>
</head>
<body>

<p>Double-click this paragraph to make it disappear.</p>

</body>
</html>

Related Tutorials