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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -