Get div height with plain JavaScript -
any ideas on how div's height without using jquery?
i searching stack overflow question , seems every answer pointing jquery's .height()
.
i tried mydiv.style.height
, returned nothing, when div had width
, height
set in css.
var clientheight = document.getelementbyid('mydiv').clientheight;
or
var offsetheight = document.getelementbyid('mydiv').offsetheight;
clientheight
includes padding.
offsetheight
includes padding, scrollbar , borders.
Comments
Post a Comment