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

No Comments

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

Image Credits: Photo by Isis França on Unsplash.

Related Articles

No results found

Leave a Reply

avatar
  Subscribe  
Notify of
Menu
Copy link