Some time we have need to turned off the display of some HTML section. On click or under some condition we need to show the hidden section. We can easily show and hide by jQuery function hide() and show() functions.
$("TagSelector").show();
Lets take an example to bulid our jQuery show and hide method concept using an example below.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button id="hide"> Hide </button>
<button id="show"> Show </button>
<div class="mydiv" >Welcome to CodingPk jQuery Tutorial. I am div i want to Show and Hide </div>
<script type="text/javascript">
$("#hide").click(function()
{
$(".mydiv").hide();
});
$("#show").click(function()
{
$(".mydiv").show();
});
</script>
$(".mydiv").hide(1000);
Remember 1 Second = 1000.