I have the following set up:
<div class="click red"></div>
<div class="click green"></div>
<div class="click blue"></div>
and when "click" is clicked I want to add the class "load" to the div. I have managed this fine, but "red" "green" and "blue" all have a background image set so I need to remove that class. Now, I know how to do this the sloppy way, I take the class for the dib "click blue" (as returned by jquery) and then strip out what I need and replace it but this is incredibly sloppy and I can't see it being the proper method.
What's the proper way to approach this? I need to remove the second class from the div and replace it with the class "load". Is there some sort of method for calling each class individually, .attr("class")[2]?