Skip to content

Instantly share code, notes, and snippets.

@imjaypatel
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imjaypatel/faf3438f543de9ebe364 to your computer and use it in GitHub Desktop.
Save imjaypatel/faf3438f543de9ebe364 to your computer and use it in GitHub Desktop.
Hide Show <p> tag in JQuery
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<p>If you click on the "Hide" button, yes I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment