how to remove CSS default class
This is my div
This is my css class
#messageContai
You can approach it two ways. One, use two classes and literally swap them out for each other:
.red { background: red }
.green { background: green }
And then in jQuery:
$("#messageContainer").attr('class','green'); // switch to green
$("#messageContainer").attr('class','red'); // switch to red
Or you can use CSS order to toggle a single class:
#messageContainer { background: red }
#messageContainer.green { background: green }
Then:
$("#messageContainer").toggleClass("green");
That would alternate backgrounds every time it was called.