jQuery innerHeight()Method

jQuery HTML/CSS 方法jQuery HTML/CSS Methods

Example

Return the inner height of the <div> element:

$("button").click(function(){ alert($("div").innerHeight()); });

Try it Yourself »

Definition and Usage

The innerHeight() method returnsthe first matched element'sinner height.

As shown in the image below, this method includes padding, but does not include border and margin.

jQuery Dimensions


Related methods:

  • width()- Set or return the width of an element
  • height()- Set or return the height of an element
  • innerWidth()- Return the width of an element (includes padding)
  • outerWidth()- Return the width of an element (includes padding and border)
  • outerHeight()- Return the height of an element (includes padding and border)

Syntax

$(selector).innerHeight()


实例

More Examples

Display dimensions with related methods
How to use width(), height(), innerHeight(), innerWidth(), outerWidth() and outerHeight().


jQuery HTML/CSS 方法jQuery HTML/CSS Methods

Other Extensions