change the background image of a div tag using javascript code example Example: js background image document.body.style.backgroundImage = "url('img_tree.png')";