Jump to: navigation, search

JQuery Hide and Show

From w3cyberlearnings

Contents

jQuery hide and show function

The $.hide() and $.show() function use to hide and show HTML element respectively.

Syntax

	$("#hide").click(function(){
		$("#test499").hide();
	});			
	$("#show").click(function(){
		$("#test499").show();
	})	

Example TRY-IT

<!DOCTYPE html>
<html>
	<head>
		<title>Hide and Show</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="jquery.min.js">
		</script>
		<script>
			$(document).ready(function(){
				$("#hide").click(function(){
					$("#test499").hide();
				})	;			
				$("#show").click(function(){
					$("#test499").show();
				})	;			
			});
		</script>
	</head>
	<body>
		<a href="#" id="hide">Hide</a> 
		<a href="#" id="show">Show</a>
		<p id="test499">
			Great leader is a great follower.
		</p>
	</body>
</html>

Related Links


Navigation
Web
SQL
MISC
References