How do I add a css class to an Div element in JQuery? I have a DIV with a css class and the div contains a form. After clicking on submit I want the original css class to disapp
I think you can use
$("#target").addClass("newclass");
for adding the class to the elemet #target and
$("#target").removeClass("newclass");
to remove it.
If you dont know wether the class is already there or not you can use
$("#target").toggleClass("newclass");
if its there, it will be removed, and if its not there it will be added.