update background image of html element js code example
Example 1: js style background image by id
document.getElementById('Demo').style.backgroundImage = "url('Test.png')";
Example 2: js background image
document.body.style.backgroundImage = "url('img_tree.png')";