Home JQuery How do I remove a css class from a div tag and then add another css class to that same div tag using JQuery?
 
 
 

How do I remove a css class from a div tag and then add another css class to that same div tag using JQuery?

PDF Print E-mail

Question: How do I remove a css class from a div tag and then add another css class to that same div tag using JQuery?

Answer:

The following code removes a css class and then adds another css class to a specific div tag

$('#div_id').removeClass("OldClass").addClass("NewClass");

#div_id = Div Tags ID
OldClass = CSS class that needs to be removed
NewClass = CSS class that needs to be added

+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 
 
Banner