how to remove CSS default class
This is my div
This is my css class
#messageContai
You aren't dealing with a class. You have default rules applied to the ID element. As such, you should really only need to add the new class:
$("#messageContainer").addClass("newRules");
Any rules that aren't overwritten can be overwritten with the css()
method:
$("#messageContainer").css({
'font-weight':'bold',
'color':'#990000'
}).addClass("newRules");