Latest web development tutorials

HTML DOM removeAttribute () 메소드

요소 참조 객체 Element 객체

스타일 속성 헤드 요소를 제거합니다 :

document.getElementsByTagName("H1")[0].removeAttribute("style");

전 속성을 삭제합니다 :

Hello World

속성을 제거합니다 :

Hello World


»시도

정의 및 사용

removeAttribute () 메서드는 지정된 속성을 삭제합니다

유사한 방법보기 removeAttributeNode을 () .


브라우저 지원

Internet ExplorerFirefoxOperaGoogle ChromeSafari

모든 주요 브라우저 removeAttribute을 지원 () 메소드


문법

요소 .removeAttribute (여기서 attributeName)

매개 변수의

参数 类型 描述
attributename String 必需。规定要删除的属性的名称。

반환 값

아니 반환 값이 없습니다.

기술 세부 사항

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


요소 참조 객체 Element 객체