document.getelementbyid().style.backgroundimage.url code example
Example: set an attribute background image javascript
document.body.style.backgroundImage = "url('img_tree.png')";
document.body.style.backgroundImage = "url('img_tree.png')";