.innerHeight() gets or sets the height of matched elements including padding, but not border or margin (getter since 1.2.6; setter since 1.8). The getter returns a unitless pixel Number.
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$("div").innerHeight() // Number → content + padding
$("div").innerHeight(100) // set inner height to 100px
$("div").innerHeight(fn) // per-element setter (1.8+)
.height() → content only
.innerHeight() → content + padding
.outerHeight() → content + padding + border
Call
What it does
.innerHeight()
Learn jQuery .innerHeight(): get or set height including padding as a unitless pixel Number, compare with .height() and .outerHeight(), callback setter since 1.8, examples, pitfalls, and FAQs.
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Select a DOM element (not window or document).
Step 2
Call .innerHeight() with no args to read content + padding as a Number.
Step 3
Pass a Number or CSS string to set that inner height on every match.
Return Value
Return Value
Description
jQuery object
Most setters and traversing helpers return the jQuery collection so you can chain more methods.
Value / undefined
Getters usually return a value from the first matched element, or undefined when nothing applies.
jQuery Examples
Example 1 — Get Inner Height of a Paragraph
Official style: read content + padding as a unitless Number.
jQuery
var p = $("p").first();
console.log("innerHeight: " + p.innerHeight() + "px");
Setter..innerHeight(90) adjusts CSS height so the padded box is 90px tall.
Pixels. A bare Number means pixels; strings can use units like "50%".
Chain. The setter returns the jQuery object for further calls.
Frequently Asked Questions
.innerHeight() with no arguments returns the height of the first matched element including padding (not border or margin) as a unitless pixel Number. .innerHeight(value) or .innerHeight(function) sets that inner height on every matched element and returns the jQuery object for chaining.
.height() is content only. .innerHeight() adds padding. .outerHeight() adds padding and border (pass true to include margin). All getters return unitless Numbers.
No. The API is for elements only. Use $(window).height() for the viewport and $(document).height() for the full page.
The getter has been available since jQuery 1.2.6. The setter .innerHeight(value) and the callback form arrived in jQuery 1.8.
Calling .innerHeight() on an empty jQuery set returns undefined (null before jQuery 3.0). Always check that your selection matched something before using the Number.
No. Values can be wrong (often 0) when the element or a parent is hidden. Measure while visible. Fractional pixels are possible — do not assume an integer.