jQuery > Effects methods

.show() - show element in jQuery

How to show an html element in jQuery?


To show a html element, show() method can be used.

 <input type="button" id="btnShow" value="Show" />

    <div id="divShow" style="height: 50px; width: 50px; background: brown; left: 0px; position: absolute; display: none;">
    </div>

    <script>
        $("#btnShow").click(function () {
            $("#divShow").show("slow");
            // $("#divShow").show("slow", QueueIt);
        });
    </script>

In the above code, on click on “btnShow” the “divShow” element will display. Like .hide() function, we can also mention second parameter as the function name to be execute when “divShow” element will be shown completely.

 Views: 5157 | Post Order: 93



Write for us






Hosting Recommendations