Alex Rivera | Logout

jQuery chaining: Can everything be chained? When can we not chain?

Asked 2011-03-31T20:02:05.770
18

I know that not all jQuery functions can be chained together. Is there a rule of thumb on this. When can we not chain 2 functions together.

Edit
Report

1 Answer

4

You can't chain a function that returns something other than a jQuery object. For example, attr() with one parameter to get the value of an attribute.

answered 2011-03-31T20:04:38.393

Your Answer