Consider de following markup:
-
I guess you should go throw all element properties and the make a sum only in this way you can know the exactly height... but in the case of the height is set it by for example clear:both property I dont think is posible to know the heigth of an Element.
A 3 sec thought could be something like:
var o document.getElementById('id').style;
var total = ((o.height.split("px")[0] == "") ? 0 : o.height.split("px")[0]) +
((o.marginTop.split("px")[0] == "") ? 0 : o.marginTop.split("px")[0]) +
((o.marginBottom.split("px")[0] == "") ? 0 : o.marginBottom.split("px")[0]) +
((o.paddingTop.split("px")[0] == "") ? 0 : o.paddingTop.split("px")[0]) +
((o.borderTop.split("px")[0] == "") ? 0 : o.borderTop.split("px")[0]) +
((o.borderBottom.split("px")[0] == "") ? 0 : o.borderBottom.split("px")[0])
But I guess you must include also the document.getElementById('id').height value if have it.... is thougth but can help..
best =)