How do I get a useful value for height and width of a div element using javascript?
Posted
by Shaun
on Stack Overflow
See other posts from Stack Overflow
or by Shaun
Published on 2010-03-29T17:37:33Z
Indexed on
2010/03/29
17:43 UTC
Read the original article
Hit count: 287
I need to be able to store the current height and width of a div at any point in time.
Currently I am using div.style.height/width which works fine when the styling is applied inline.
The problem is that this returns for example 600px and not 600.
Is there a better way to do this? If not, whats the best way to get just the number 600?
© Stack Overflow or respective owner