Hide Contents on Click Event


In this article we will see how to hide html page contents on click event using jQuery.

<html>
<head>
<title>Hide Content Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" />
</head>
<body>
<p>If you click on me, I will disappear.</p>
<p>Click me away!</p>
<p>Click me too!</p>
<script>
$(document).ready(function() {
    $("p").click(function(){
        $(this).hide();
    });
});
</script>
</body>
</html>  

Check live demo here : Hide Contents on Click Event

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s