I find it odd that everything works perfectly fine with document.body.style.background, yet I can't seem to change the style of this particular div.
Here is the code snippet:
var container = document.getElementById("container");
var updateTime = function() {
var currentTime = new Date,
currentHours = currentTime.getHours().toString(),
currentMinutes = currentTime.getMinutes().toString(),
currentSeconds = currentTime.getSeconds().toString();
if (currentHours < 10) {
currentHours = "0" + currentHours;
}
if (currentMinutes < 10) {
currentMinutes = "0" + currentMinutes;
}
if (currentSeconds < 10) {
currentSeconds = "0" + currentSeconds;
}
container.style.background = "#" + currentHours + currentMinutes + currentSeconds;
}
setInterval(updateTime, 1000);