My current setup includes the following:
<div class="click red"></div>
<div class="click green"></div>
<div class="click blue"></div>
When the "click" is clicked, I want to add the class "load" to the div. I have successfully achieved this, but the "red," "green," and "blue" classes all have background images set, so I need to remove those classes. While I know how to do this in a sloppy way by extracting the class for the div "click blue" (as returned by jQuery), stripping out what I need, and replacing it, I believe there must be a more proper method.
What is the correct approach to accomplish this task? I need to remove the second class from the div and replace it with the class "load." Is there a specific method to call each class individually, something like .attr("class")[2]?