jQuery EffectsLesson 13Free preview
jQuery Chaining
This lesson is part of jQuery · All levels
Summary
Chaining allows you to stack multiple jQuery methods into one line of expression. Each method returns the same jQuery object, so the next method can be called immediately. The result is a much more concise code without having to store repeated selections in the variable.
Key points
- Chaining means calling several methods in a row on one line
- Most jQuery methods return jQuery objects so that they support the chain.
- Chains executed from left to right
- Chains make code more concise and reduce repeated selection
- Methods that return data values, for example text(), break the chain
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.