Hiding a paragraph element with #jQuery

Way to Struts 1.2 DataSource

This post assumes you’ve downloaded the jquery js file and saved it in the same folder.

Code:

<html>
<head>
<script src="jquery-1.9.1.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>
<body>
<h2>HIDING A PARAGRAPH ELEMENT WITH jQUERY</h2>
<p>THIS IS PARA 1.</p>
<p>THIS IS PARA2.</p>
<button>Click me</button>
</body>
</html>

Try it and let me know!

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