I am not asking what is the appropriate syntax for chaining, I know it could be something like:
$('myDiv').removeClass('off').addClass('on');
As far as I know chaining is one of the advantages against other famous frameworks. Can someone explain to me how chaining works here?
If you have an object with certain methods, if each method returns an object with methods, you can simply call a method from the object returned.
DEMO: http://jsfiddle.net/5kkCh/