Latest web development tutorials

HTML DOM getAttributeNode () 메소드

요소 참조 객체 Element 객체

링크 대상 속성을 반환합니다 :

document.getElementsByTagName("a")[0].getAttributeNode("target");

»시도

정의 및 사용

getAttributeNode () 메소드는 현재 요소에서 이름을 지정해 속성 노드를 얻을 수 있습니다.

팁 : 전용 속성 값을 반환 할 경우, 사용 하는 getAttribute의 방법을.


브라우저 지원

Internet ExplorerFirefoxOperaGoogle ChromeSafari

모든 주요 브라우저 getAttributeNode를 지원 () 메소드


문법

element.getAttributeNode( attributename )

매개 변수

参数 类型 描述
attributename String 必须。你想返回的属性名。

반환 값

类型 描述
Attr object 指定的属性节点

기술 세부 사항

DOM 버전 코어 레벨 1 요소 개체


요소 참조 객체 Element 객체