Handle click event on <p> element and hide elements - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:serializeArray

Description

Handle click event on <p> element and hide elements

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").click(function(){
        $(this).hide();//w w  w  .  ja  v  a 2s  .  c  om
    });
});
</script>
</head>
<body>

<p>Click me!</p>
<p>Click me!</p>
<p>Click me!</p>

</body>
</html>

Related Tutorials