function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
var red = getRandomInt(255);
var green = getRandomInt(255);
var blue = getRandomInt(255);
$(".div").css("backgroundColor", "rgb(" + red + "," + green + "," + blue + ")" );