[jQuery] innerHeight - CSS

<style>
#rect0{
  margin:10px;
  width:100px;
  height:100px;
  display:block;
  padding:8px;
  background-color:#aaa;
}
</style>

$('#btn0').click(function(){
  $('#input0').val( 'document innerHeight : ' + $(document).innerHeight() + 'px' );
  $('#input1').val( 'window innerHeight : ' + $(window).innerHeight() + 'px' );
  $('#input2').val( 'div innerHeight : ' + $('#rect0').innerHeight() + 'px' );
  $('#input3').val( 'p innerHeight : ' + $('#rect0 p').innerHeight() + 'px' );
});

.innerHeight() return number
指定した要素の内部高さを取得する

id = rect0

内部高さを取得する