jQuery > Effects methods

.hide() - Hide particular element in jQuery

How to hide a particular element in jQuery?

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

<input type="button" id="btnHide" value="Hide" />

    <div id="divHide" style="height: 50px; width: 50px; background: red; left: 0px; 
position: absolute;"></div>

    $("#btnHide").click(function () {
        // $("#divSlideDown").hide("slow", QueueIt);

In the above code, on click of the button “btnHide”, the element “divHide” hides.

We can also specify a function name (to execute) in the second parameter of .hide() function. This function (in this case, QueueIt) will execute when the .hide() funciton completes its job.

 Views: 989 | Post Order: 91

Write for us