I am trying to get the height or width or left or top of a layer that has not been explicitly set or has been set to a percentage.
i.e.
#DIV {position: absolute; width: 100%}
<div id="DIV">
</div>
I am changing the innerHTML of this layer and then trying to get the height so I can lay out the page without overlapping. When I use:
alert(document.getElementById("DIV").style.height);
I get the error message:
"style.height" is null or not an object.
Why is this happening?
i.e.
#DIV {position: absolute; width: 100%}
<div id="DIV">
</div>
I am changing the innerHTML of this layer and then trying to get the height so I can lay out the page without overlapping. When I use:
alert(document.getElementById("DIV").style.height);
I get the error message:
"style.height" is null or not an object.
Why is this happening?