How can I remove all classes that are not named "message" from an element?
- by Marilou
I have the following:
<div id="abc">
</div>
Inside that div there can be one only of the following:
<p class="message">
<p class="message error"></p>
<p class="message warning"></p>
<p class="message success"></p>
<p class="message loading"></p>
Is there a way that I can find and remove only the class from the <p> element that's NOT "message". I realize I could remove everything and then add what I need with .removeClass() but this won't work for me as after I previously added the message class I did some CSS changes and these will be lost if I remove all and then add again the message class.