======Javascript HTML DOM getAttribute() Method====== * description : Javascript HTML DOM textContent Property * author : 오션 * email : shlim@repia.com * lastupdate : 2021-06-08 \\ =====The source of the article==== [[https://www.w3schools.com/jsref/met_element_getattribute.asp|Javascript HTML DOM getAttribute() Method]]\\ ====Example==== %%

%% 요소의 클래스 속성 값을 가져옵니다.\\

Hello World

Click the button to display the value of the class attribute of the h1 element.

=====Definition and Usage===== %%getAttribute()%% 메서드는 요소의 지정된 이름을 가진 속성 값을 반환합니다.\\ \\ **Tip:** 속성(attribute)을 %%Attr%% 객체로 반환하려면, %%getAttributeNode()%% 메서드를 사용하십시오.\\ =====Syntax===== element.getAttribute(attributename) =====Parameter Values===== | Parameter ^ Type ^ Description ^ | attributename | String | 필수입니다. 값을 구하려는 속성의 이름 | =====Technical Details===== ^ Return Value ^ 문자열이며 특정 속성 값을 표시합니다. ^ | | **Note:** 속성이 존재하지 않을 경우, 반환 값은 null 또는 비어있는 문자열("") 입니다. | =====More Examples===== ====Example==== %%%% 요소의 타겟(target) 속성 값을 가져옵니다.\\ Read about the Attr object

Click the button to display the value of the target attribute of the link above.

====Example==== %%

{{tag>오션, Javascript HTML DOM getAttribute() Method}}