jQuery: What’s the difference between height, innerHeight and outerHeight?

I was surprised to find there is no simple online comparison giving an overview of the difference between JQuery’s height, innerHeight and outerHeight. It’s really quite simple and is down to whether the calculation factors in padding, border and margin.

Here’s the summary:

Padding Border Margin
height  –  –  –
innerHeight  ok  –  –
outerHeight  ok  ok  –
outerHeight(true)  ok  ok  ok
The same applies to width, innerWidth and outerWidth
Facebook Comments
Rate this post