Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is chaining in jQuery?

Answer Posted / chaitanya

Chaining is one of the most powerful feature of jQuery. In jQuery, Chaining means to connect multiple functions, events on selectors. It makes your code short and easy to manage and it gives better performance. The chain starts from left to right. So left most will be called first and so on.

Hide Copy Code

​$(document).ready(function(){

$('#dvContent').addClass('dummy');

$('#dvContent').css('color', 'red');

$('#dvContent').fadeIn('slow');

});​

The above jQuery code sample can be re-written using chaining. See below.

Hide Copy Code

​$(document).ready(function(){

$('#dvContent').addClass('dummy')

.css('color', 'red')

.fadeIn('slow');

});​

Not only functions or methods, chaining also works with events in jQuery. Find out more here.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cdn and how jquery is related to it?

849


Explain deferred and promise object in jquery? : jquery mobile

827


What is the use of jQuery.data() method?

902


Tell me which command will give a version of jquery?

811


Why content injected into a page is not enhanced? : jquery mobile

819


What are jquery plugins?

851


What is the method used to define the specific character in place of $ sign?

1017


What is the advantage of using minimized version of jQuery?

865


What is parseint() and why it is used?

910


Is it possible to use jquery to make ajax request? : jquery mobile

899


How to resolve conflicts with other libraries?

903


How do you install/use jquery in a project. What is the minimum setup needed to start using jquery.

942


Difference between javascript and jquery? : jQuery Mobile

877


What is the use of noconflict() method in jquery?

856


How do I check if an element is hidden in jQuery?

870