I am kind of new to Web Development and I was trying to access a property of and id.style in my site, but unfortunately there was no response in my program so I have uploaded my problem in this code. please also tell me how to change that value.
function myMove() {
var elem = document.getElementById("container");
alert(elem.style.top);
}
#container {
width: 400px;
height: 400px;
top: 10px;
position: relative;
background: yellow;
}
<p><button onclick="myMove()">Click Me</button></p>
<div id="container"></div>