jQuery <p> handle double click event

Description

jQuery <p> handle double click event

View in separate window

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Executing a Function on Double-click Event in jQuery</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<style>
    p{/* w ww  .  j  ava  2s .c  om*/
        padding: 20px;
        font: 20px sans-serif;
        background: khaki;
    }
</style>
<script>
$(document).ready(function(){
    $("p").dblclick(function(){
        $(this).slideUp();
    });
});
</script>
</head>
<body>
    <p>Double-click on me and I'll disappear.</p>
    <p>Double-click on me and I'll disappear.</p>
    <p>Double-click on me and I'll disappear.</p>
</body>
</html>



PreviousNext

Related