I’ve googled this but didn’t find an answer, this is strange. In Javascript in Firefox when I do object.style.height it doesn’t return anything. Would anybody know why?
In CSS I’ve put
#movable {
height: 100px;
....
In HTML I’ve put
<div id="movable"> </div>
And in JS:
alert(movable.style.height);
element.styleis just a conversion of the element’sstyleattribute into a scriptable object. If you haven’t set any inline style on the element, you won’t get anything back.If you want to query the dimensions of an element, there are a number of ways, such as
object.getBoundingClientRect().