jQuery removeAttr() 메서드

❮ jQuery HTML/CSS 메소드

예시

모든 <p> 요소에서 스타일 속성을 제거합니다.

$("button").click(function(){
  $("p").removeAttr("style");
});

정의 및 사용

removeAttr() 메소드는 선택된 요소에서 하나 이상의 속성을 제거합니다.


통사론

$(selector).removeAttr(attribute)

Parameter Description
attribute Required. Specifies one or more attributes to remove. To remove several attributes, separate the attribute names with a space

직접 해보십시오 - 예


에서 id 및 class 속성을 제거하는 방법입니다.


❮ jQuery HTML/CSS 메소드