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.
.click()method, like any other jQuery methods, simply returns the jQuery object, and does not conditionally fire whatever that is chained after it based on the click event. That's why. In fact, if you swap the order around.css().click()it does exactly the same thing.