how to set an image as background in javascript code example Example: js background image document.body.style.backgroundImage = "url('img_tree.png')";