Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>HTML Style Object</h1>
<h2>The backgroundImage Property</h2>
<p>The background image is:</p>
<p id="demo"></p>
<div id="myDiv" style="background-image:url('img_tree.png');border:1px solid black;height:400px;width:400px;">
This is myDiv.</div>
<br>
<script>
let img = document.getElementById("myDiv").style.backgroundImage;
document.getElementById("demo").innerHTML = img;
</script>
</body>
</html>