I'm not sure if I'm going to completely crazy or if there's something wrong with my computer.
I have a simple piece of JavaScript below but when I console log the style object it is completely empty. This is despite the fact the the element in question clearly has styles attached to it.
<!doctype html>
<html>
<head>
<style>
#para{
width: 100px;
height: 100px;
position: absolute;
left: 200px;
top: 10px;
border: 1px solid red;
}
</style>
</head>
<body>
<div id="para" class="paraDiv">This is the div</div>
<script>
window.onload = function(){
var d = document.getElementById('para');
console.dir(d);
console.log(d.style.top);
}
</script>
</body>
</html>