// change bg image document.getElementById("div1").style.backgroundImage = "url(someImage.jpg)"; // change bg color document.getElementById("div2").style.background = '#000000';