Monday, 26 December 2011

Add remove css class using JQuery

You can do this by using the addClass and removeClass functions in jquery.

For add new class or properties use add class

$("#link").click(function(){
   $(#mydiv).addClass('myClass');
});
 
For remove existing class or properties use remove class
 
$("#link").click(function(){
   $("#mydiv").removeClass('myClass');
});
 

No comments:

Post a Comment