• Register
Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

What is method chaining in jQuery? What is the benefit of using method chaining?

0 votes
83 views

What is method chaining in jQuery? What is the benefit of using method chaining?

asked Nov 12, 2015 in jQuery by SUMIT SINGH

2 Answers

0 votes

jQuery Method chaining:- In jQuery, the method chaining is calling another method in result of another method, it result in clean and concise code, single search over DOM so it provides us better performance.

answered Nov 12, 2015 by john12 (2,680 points)
0 votes

Method Chaining:- Method chaining is a process through which we are calling another method in result of another method, it result in clean and concise code, single search over DOM so it gives better performance. This is the main benefits.

For example:- The "jQuery" or "$" returns itself (an object) which allows the chaining. Basically the first function call $('myDiv') returns a jQuery object, then each subsequent call returns the same one

answered Nov 15, 2015 by john12 (2,680 points)
...