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

Explain how jquery works?

795


Differentiate between calling stop (true, true) and finish method?

799


Define width() vs css('width')?

725


What features of jquery, has been used in web applications?

738


What is resize() function in jquery?

873


Explain the difference between body onload() and document.ready() function? : jquery mobile

773


How to multiple AJAX requests be run simultaneously in jQuery?

776


What is the use of jquery.data()?

791


Is jquery a framework?

742


What is the use of queue() in jquery?

775


Which one is more efficient, document.getelementbyid( "idname") or $("#idname)?

697


What is the latest version of jquery?

840


How can we apply css in div using jquery?

865


What is the difference between size and length of jQuery?

795


What are selectors in jquery mean ?

856