jQuery .height()

1 개요[ | ]

jQuery .height()
  • HTML 요소의 높이를 조회하거나 지정하는 jQuery 메소드
html
Copy
<style>
div { border: 1px solid red; }
</style>

<div id='d1'>Hello</div>
<div id='d2'>World</div>

<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$("#d2").height(50); // 높이 지정

console.log( 'd1 height = ' + $("#d1").height() );
console.log( 'd2 height = ' + $("#d2").height() );
</script>
d1 height = 19 
d2 height = 50 

2 같이 보기[ | ]

3 참고[ | ]