Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the height of a element including padding and borders using javascript

i would like to know how to get the height of a element including padding and borders using javascript so ill know the actually height the element has when rendered in a browser. Can anyone help me please and im still new to javascript

like image 684
harry Avatar asked Feb 05 '11 22:02

harry


1 Answers

Using jQuery, you can get element height including padding with $(ele).outerHeight(), get element height including padding, border and margin by $(ele).outerHeight(true).

see also https://api.jquery.com/outerHeight/

like image 106
aztack Avatar answered Oct 11 '22 22:10

aztack