자바스크립트 요소 속성 추가1 Element.setAttribute(), Element.getAttribute(), Element.removeAttribute() Element.setAttribute() Element의 속성 값을 지정된 이름과 값으로 설정한다. 속성이 이미 있는 경우 값이 업데이트된다. Element.setAttribute(name, value); Element.getAttribute() Element의 지정된 이름의 속성 값을 반환한다. 존재하지 않는 속성 이름을 입력하면 null을 반환한다. Element.getAttribute(name); Element.removeAttribute() Element의 지정된 이름의 속성 값을 제거한다. Element.removeAttribute(name); Prev Next 2022. 11. 8. 이전 1 다음 728x90