set the background-image in javascript code example
Example 1: js background image
document.body.style.backgroundImage = "url('img_tree.png')";
Example 2: inserting a image in html backgound
<html>
<style>
body
{
background-color: url('url from web'); /* replace "url from the web" with your url*/
}
</style>
<body>
<!-- Your body displayed with the picture-->
<h1></h1>
</body>
</html>