Turning Learners Into Developers
Codekilla
CODEKILLA
back to course
Lesson 31 / 8736%
Effects & Animation2/8

toggle()

Hide if shown, show if hidden — great for mobile menus.

// every call returns the jQuery object — chain forever$('#box')select.addClass('active')DOM.css('color','white')CSS.slideDown(200)effect.fadeOut(400)effect// return value after every call:jQuery({ 0: <div#box>, length: 1, prevObject: … })
Visual explanation diagram · click steps to walk through it

This lesson is Pro only.

Unlock every premium lesson and module — Pro from ₹299 / month (or ₹999 / year, saves ~₹2,589).

Sign in to unlock
// feedback.matters()
Did this lesson help you?