Tuesday, December 14, 2010

jQuery add class to element: How to add a class to a div

Adding class or removing a css class from an element with jQuery or Prototypejs is very simple.

// With JQuery


// With Prototypejs...


// Removing a class with Jquery


// With Prototypejs...

Once again, jQuery has shorter function names which is awesome!