The .hide() method hides an HTML element.


$(selector).hide(speed, callback);
  • selector: Specifies the elements that will be hidden.
  • speed(optional): Can be “slow” or “fast” or the number of milliseconds.
  • callback(optional): A function that is called once the element is hidden.


The following jQuery code will hide the element selected with #hide when it is clicked:

$("#hide").click(function() {


Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn JavaScript on Codecademy