jQuery w3schools 한글판 강좌62-jQuery - Dimensions-jQuery width() and height() Methods > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

jQuery w3schools 한글판 강좌62-jQuery - Dimensions-jQuery width() and height() Methods 정보

jQuery jQuery w3schools 한글판 강좌62-jQuery - Dimensions-jQuery width() and height() Methods

본문

jQuery w3schools 한글판 강좌62-jQuery - Dimensions-jQuery width() and height() Methods 

 

jQuery width(), height() 메소드

width() 메소드는 요소의 폭값(패딩, 보더와 마진은 제외한)을 설정 또는 반환합니다.

height() 메소드는 요소의 높이값(패딩, 보더와 마진은 제외한)을 설정 또는 반환합니다. 

 

다음 예는 지정된 <div> 요소의 폭과 높이값을 반환합니다.

Example

$("button").click(function(){
    var txt = "";
    txt += "Width: " + $("#div1").width() + "</br>";
    txt += "Height: " + $("#div1").height();
    $("#div1").html(txt);
});
추천
0
  • 복사

댓글 0개

© SIRSOFT
현재 페이지 제일 처음으로