.innerHeight()
Categories: Style Properties | CSS | Dimensions
.innerHeight()Returns: Integer
Description: Get the current computed height for the first element in the set of matched elements, including padding but not border.
-
.innerHeight()
version added: 1.0
This method returns the height of the element, including top and bottom padding, in pixels.
This method is not applicable to window
and document
objects; for these, use .height()
instead.
-
Get the innerHeight of a paragraph.
HTML:
<p>Hello</p><p></p>
CSS:
p { margin:10px;padding:5px;border:2px solid #666; }
Code:
var p = $("p:first"); $("p:last").text( "innerHeight:" + p.innerHeight() );
.innerHeight( value )Returns: jQuery
Plugin: jQuery.fn.size
Description: Set the current computed height for each element in the set of matched elements, including padding but not border.
-
.innerHeight( value )
version added: 1.0value An integer representing the number of pixels.
This method set the height of the element, including top and bottom padding, in pixels.
This method is not applicable to window and document objects.
-
Set the inner height of all div elements with class box.
HTML:
<div class="box"></div>
CSS:
.box { position: absolute, margin: 15px, border: solid 5px, padding: 10px, width: 100px, height: 100px }
Code:
$('div').innerHeight(300);
Results:
<div class="box" style="height: 280px;"></div>