From the course: jQuery Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

jQuery statement chaining

jQuery statement chaining - jQuery Tutorial

From the course: jQuery Essential Training

Start my 1-month free trial

jQuery statement chaining

- [Joe] I want to point out one of jQuery's more interesting features and that is its ability to chain multiple functions together. This is called statement chaining. It basically allows you to perform several operations on a result set in just one line of code. Up until now, you've seen a lot of code that looks like this. A jQuery selector statement followed by a function call that operates on the result set that comes back. However, I can chain multiple function calls together, one after another to operate on the result set as you see here. This is called a statement chain. These functions will get executed in order, starting on the left and going across to the right. So the selector will execute, then the results that will come back and I can do multiple operations on those objects. I can assign CSS, I can manipulate the content, I can turn events on and off. And the reason why this makes jQuery so powerful is that it allows you to perform multiple operations on one result set…

Contents