Tuesday, January 11, 2011

Get element height - Javascript

When you try to get the height of an element that does not exist yet elem.style.height won't work.

So this is how it should be retreived:

document.getElementById('elem_name').offsetHeight;

No comments:

Post a Comment