0 votes
423 views
in jQuery by

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

2 Answers

0 votes
by (4.4k points)

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.

0 votes
by (4.4k points)

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

Share:- Whatsapp Facebook Facebook


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

Categories

...