do you test the code before posting it on the website? In which language you have written and in which browser you have tested? Your code is not working. I could change the above code as below and its working now.
document.body.bgColor = c;