Hide and Show in JQuery

Using hide() and show() method to hide and show HTML elements.

Example :

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("#hidesection").click(function(){
        $("p").hide();
    });
    $("#showsection").click(function(){
        $("p").show();
    });
});
</script>
</head>
<body>

<p>This content will hide when you click on Hide Button. and show content when you click show button</p>

<button id="hidesection">Hide</button>
<button id="showsection">Show</button>

</body>
</html>
Quick ask your Question