top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is Chaining in jQuery?

+5 votes
140 views

Explain with sample code.

posted Feb 24, 2014 by Asmita Agrawal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

With jQuery, you can chain together actions/methods. Chaining allows us to run multiple jQuery methods (on the same element) within a single statement.

jQuery Method Chaining
Chaining 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.

$("#p1").css("color","red").slideUp(2000).slideDown(2000);
answer Feb 25, 2014 by Salil Agrawal
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...