I have a div with a background image positioned at X 0px and Y 0px position. Now I want to return this values in a console.log, but the console shows me a blank entry. I tried with alert and is the same.
Why is this happening?
var myDiv = document.getElementsByClassName('myDiv')[0];
console.log(myDiv.style.backgroundPositionY);
.myDiv{
width:200px; height:200px;
background:blue;
background-image:url(http://www.shunvmall.com/data/out/141/46916550-landscape-pictures.jpeg);
background-repeat:no-repeat;
background-position:0px 0px;
background-size:cover;
}
<div class="myDiv"></div>