Welcome to findnerd
Today we are going to discuss hide() method and show() method in jQuery
firstly, let start hide() method
hide() method is used for hiding data with HTML elements
Syntex of hide()
$(selector).hide();
And now about show() method
show() method is used for showing data with HTML elements
Syntex of hide()
$(selector).show();
you can see bellow example for good understanding
<!DOCTYPE html>
<html>
<head>
<!-- here call the jquery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();// call hide() method on paragraf
});
$("#show").click(function(){
$("p").show();// call show() method on paragraf
});
});
</script>
</head>
<body>
<p>Hi all welcome to findered.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
</body>
</html>
0 Comment(s)