I'm trying to use the Jquery animate feature to change the background color of a div. If a random number is below 50 animate red and if higher than 50 animate green. Everything seems to work except for the color change. What I'm I doing wrong here?
function randomInt(min,max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
if (randomInt(1, 100) > 50) {
$('#status').html("win").animate({backgroundColor: "green" }, "fast");
} else {
$('#status').html("lose").animate({ backgroundColor: "red" }, "fast");
}