I need the full height of a div, I\'m currently using
document.getElementById(\'measureTool\').offsetHeight
offsetHeig
in Vanilla JS in the function getAllmargin we get the sum of both margin top and bottom and with clientHeight we get the height including all paddings
var measureTool = document.getElementById('measureTool');
function getAllmargin(elem){
//Use parseInt method to get only number
return parseInt(window.getComputedStyle(elem, null).getPropertyValue('margin-top'))
+ parseInt(window.getComputedStyle(elem, null).getPropertyValue('margin-bottom'));
}
//Finally we get entire height
console.log(measureTool.clientHeight + getAllmargin(measureTool));