To Change CSS using jquery there are two ways:
1.Using SwithClass
2.Using remoceClass and addClass
example:
<div class=''Red"></div>
To remove the css of above div we can use $("#div").removeClass(''Red");//Red is the css class
To add new css we can use $("#div").removeClass("Yellow");//Yellow is the css Class
when we want to change css class of an element there is an another option in jquery i.e switchClass
eg : $("#div").switchClass("Previousclass","NewClass","1000","behaviour");
it works faster than add and remove class .
enjoy coding
1.Using SwithClass
2.Using remoceClass and addClass
example:
<div class=''Red"></div>
To remove the css of above div we can use $("#div").removeClass(''Red");//Red is the css class
To add new css we can use $("#div").removeClass("Yellow");//Yellow is the css Class
when we want to change css class of an element there is an another option in jquery i.e switchClass
eg : $("#div").switchClass("Previousclass","NewClass","1000","behaviour");
it works faster than add and remove class .
enjoy coding