Answers for "get the width and height of a div"

23

Javascript get element height and width

var width = document.getElementById('myID').offsetWidth;//includes margin,border,padding
var height = document.getElementById('myID'). offsetHeight;//includes margin,border,padding
Posted by: Guest on July-26-2019
-1

how to get the height of a div in css

var clientHeight = document.getElementById('exampleElement').clientHeight;
alert(clientHeight);

var offsetHeight = document.getElementById('exampleElement').offsetHeight;
alert(offsetHeight)
Posted by: Guest on June-01-2021

Code answers related to "get the width and height of a div"

Code answers related to "Javascript"

Browse Popular Code Answers by Language