Edit This Code:
<!DOCTYPE html>
<html>
<body>

<button type="button" onclick="myFunction()">Get background position</button>
<br>
<div id="myDiv" style="background: url('img_tree.png') no-repeat center;height:500px;width:500px;border:1px solid black;">
</div>

<script>
function myFunction() {
    alert(document.getElementById("myDiv").style.backgroundPosition);  
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy