I'm trying to pull CSS data out of an element but I am hitting a wall for some reason. I have been staring and trying to tweak the same line of code for an hour and I keep getting undefined or NaN.
Here is the abbreviated js:
var newVar = document.getElementById("cssItem").style.top;
The css:
#cssItem {
position: absolute;
top: 100px;
left: 100px;
width: 600px;
height: 400px;
}
Again, every time I log newVar it comes back undefined or NaN.