innerHeight() method in jQuery

innerHeight() in jQuery

This method is used to get the current inner height of the first element in the set of matched elements.

innerHeight value includes padding, but doesn't consider margin and border.

Syntax 1

$(selector).innerHeight()

Syntax 2

$(selector).innerHeight(value)

  • value - An integer representing the number of pixels
Syntax 3

$(selector).innerHeight(function(index,currentInnerHeight))

  • index - index position of the element in the set.
  • currentInnerHeight - old inner height of the element.

Example 1 - get

Try Yourself

Example 2 - set

Try Yourself

Example 3 - with function

Try Yourself

Example 4 - Difference between height() and innerHeight()

Try Yourself

Example 5 - Difference between innerHeight() and outerHeight()

Try Yourself