Мне нужна полная высота div, в настоящее время я использую
document.getElementById('measureTool').offsetHeight
offsetHeight
- возвращает высоту элемента, включая границы и отступы, если они есть, но не поля
Но один из вложенных элементов внутри div имеет margin-top
of 20%
, поэтому я получаю неправильное измерение. Я пробовал style.marginTop
и scrollHeight
без успеха.
Как я могу получить полную высоту (границу, дополнение, margin) элемента (div) в javascript?
Если нет другого способа, я в порядке с jQuery.