method chaining requires every method to return the jquery object but,
when we use:
$("div").click(function(){ //some code }).css("backgroundColor","blue").
how does the css method get executed without clicking the div? how does it know the jquery object without click event gets triggered.
Here chaining will work like
$("div").css("backgroundColor","blue").click(function(){ //some code });
Below is the working code snippet for the same.