Skip to content Skip to sidebar Skip to footer

How To Hide Div Onclick And Show Onclick Using Jquery

I'm integrating a search suggest function in a oscommerce script. The function is working properly, but I need to create a div hide onclick and shown on input click using Jquery (w

Solution 1:

By using Jquery hide() and show() methods you can do this..Try ...)

$(document).ready(function(){
    $("#hide").click(function(){
        $("p").hide();
    });
    $("#show").click(function(){
        $("p").show();
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<p>If you click on the "Hide" button, I will disappear.</p>

<button id="hide">Hide</button>
<button id="show">Show</button>

Post a Comment for "How To Hide Div Onclick And Show Onclick Using Jquery"