Set a random background color to and element
function setbgColor(){
var r = Math.floor(Math.random() * 256);
var g = Math.floor(Math.random() * 256);
var b = Math.floor(Math.random() * 256);
var obj = document.getElementById('id');
if(obj){
obj.style.background = 'rgb(' + r + ',' + g + ',' + b + ')';
}
}