Say I have a class named testThing:
.testThing
{
background-color:#000000;
float:left;
height:50px;
width:50px;
}
And I want to
Jquery adds CSS in the style attribute which has higher priority over what is in your CSS file. You're not changing your CSS document with that function and thus adding and removing and adding the class have no effect since it hasn't been modified at all!
You should use the same function but set the background color to black this time.
function reset(this)
{
$(this).css('background-color', '#000000');
}
Or simply remove the style attribute
function reset(this)
{
$(this).removeAttr('style');
}