What is the slideUp method in jQuery?

In jQuery, the slideUp() method is used to slide an element up in the jQuery collection.

Syntax

(a).slideUp(b, c)
  • a is the element to be acted upon.

  • b (optional) is the speed parameter. It is used to specify the duration of the event; it can be in milliseconds or either be slow or fast.

  • c (optional) is the callback function that gets called once the sliding is over.

Code

In the code below, the text "Learn tech-related contents easily and at your own pace!" gets hidden as it slides up once the Slide Up button is clicked.

New on Educative
Learn any Language for FREE all September 🎉
For the entire month of September, get unlimited access to our entire catalog of beginner coding resources.
🎁 G i v e a w a y
30 Days of Code
Complete Educative’s daily coding challenge every day in September, and win exciting Prizes.

Free Resources