<html>
<body>
<div id="myDiv" style="position:absolute;right:15px;">This is a div element.</div>
<button type="button" onclick="myFunction()">Return right position of div</button>
<script>
function myFunction() {
alert(document.getElementById("myDiv").style.right);
}
</script>
</body>
</html>