I have table which class is forum
. My jquery code:
Set the original background-color in you CSS file:
.forum{
background-color:#f0f;
}
You don't have to capture the original color in jQuery. Remember that jQuery will alter the style INLINE, so by setting the background-color to null you will get the same result.
$(function() {
$(".forum").hover(
function() {
$(this).css('background-color', '#ff0')
}, function() {
$(this).css('background-color', '')
});
});