This is it. it's IT.

javascript - attr (속성) 관련 기능 본문

Javascript

javascript - attr (속성) 관련 기능

응애개발자 애기 2022. 5. 20. 17:17
728x90
반응형

 

.attr( attributeName )

속성 값 가져오기 

 

$( 'div' ).attr( 'class' );

예시

 

 

 

.attr( attributeName, value );



$( 'h1' ).attr( 'title', 'Hello' );//예시

속성 추가하기

 

 

 

 

 

 

 

https://www.codingfactory.net/10208

 

jQuery / Method / .attr() - 속성(attribute)의 값을 가져오거나 속성을 추가하는 메서드

.attr() .attr()은 요소(element)의 속성(attribute)의 값을 가져오거나 속성을 추가합니다. 문법 1 .attr( attributeName ) 선택한 요소의 속성의 값을 가져옵니다. 예를 들어 $( 'div' ).attr( 'class' ); 는 div 요소의

www.codingfactory.net

 

 

728x90

'Javascript' 카테고리의 다른 글

자바스크립트와 객체지향  (0) 2022.05.26
페이지 알고리즘  (0) 2022.05.24
ajax 골격  (0) 2022.05.18
selected된 option의 값을 가져와서 처리하는 법  (0) 2022.05.13
서버와 클라이언트  (0) 2022.05.12
Comments