In jQuery Method Chaining, there is a technique called chaining, that allows us to run multiple jQuery commands, one after the other, on the same element(s). This way, browsers do not have to find the same element(s) more than once.
To chain an action, you simply append the action to the previous action. The following example chains together the css(), slideUp(), and slideDown() methods. The “div1” element first change to red, then it slides up, and then it slides down:
This also works just fine: