HTMLElement

HTMLElement 인터페이스는 모든 종류의 HTML 요소를 나타냅니다. 일부 요소는 이 인터페이스를 직접 구현하지만 나머지 요소는 HTMLElement를 상속한 자식 인터페이스를 구현합니다.

EventTarget Node (en-US) Element (en-US) HTMLElement

속성

부모인 Element (en-US)의 속성을 상속합니다. GlobalEventHandlers, TouchEventHandlers의 속성을 구현합니다.

HTMLElement.accessKey

요소에 할당된 접근 키를 나타내는 DOMString입니다.

HTMLElement.accessKeyLabel 읽기 전용

요소에 할당된 접근 키를 포함하는 DOMString을 반환합니다.

HTMLElement.contentEditable

요소가 수정 가능하면 "true", 그렇지 않으면 "false" 값을 갖는 DOMString입니다.

HTMLElement.isContentEditable (en-US) 읽기 전용

요소의 콘텐츠가 수정 가능한지 여부를 나타내는 Boolean을 반환합니다.

HTMLElement.contextMenu 지원이 중단되었습니다

요소와 관련된 콘텍스트 메뉴를 나타내는 HTMLMenuElement (en-US)입니다. null일 수 있습니다.

HTMLElement.dataset (en-US) 읽기 전용

요소의 사용자 지정 데이터 속성(data-*)을 스크립트에서 읽고 쓸 수 있는 DOMStringMap (en-US)을 반환합니다.

HTMLElement.dir (en-US)

요소의 방향성을 표현하는 전역 속성 dir 을 나타내는 DOMString 을 반환합니다. 가능한 값은 "ltr", "rtl", "auto" 입니다.

HTMLElement.draggable (en-US)

요소가 드래그 가능한지 여부를 나타내는 Boolean 을 반환합니다.

HTMLElement.dropzone 읽기 전용

dropzone 전역 속성을 나타내고 drop 작업에 대한 동작을 설명하는 DOMSettableTokenList 를 반환합니다.

HTMLElement.hidden (en-US)

요소가 숨김상태인지 여부를 나타내는 Boolean 을 반환합니다.

HTMLElement.inert (en-US)

유저 에이전트가 사용자 인터렉션 이벤트, 페이지 내 텍스트 검색("페이지에서 찾기"), 텍스트 선택의 목적으로 주어진 노드가 없는 것처럼 동작해야하는지 여부를 나타내는 Boolean 을 반환합니다.

HTMLElement.innerText

노드와 그 자손의 "렌더링된" 텍스트 컨텐츠를 나타냅니다. getter 로써, 이는 사용자가 커서로 요소의 컨텐츠를 하이라이팅한 후 클립보드로 복사하면 얻을 수 있는 텍스트와 유사합니다.

HTMLElement.itemScope Experimental

항목 스코프를 나타내는 Boolean 입니다.

HTMLElement.itemType 읽기 전용 Experimental

DOMSettableTokenList… 를 반환합니다.

HTMLElement.itemId Experimental

항목 ID 를 나타내는 DOMString 입니다.

HTMLElement.itemRef 읽기 전용 Experimental

DOMSettableTokenList… 를 반환합니다.

HTMLElement.itemProp 읽기 전용 Experimental

DOMSettableTokenList… 를 반환합니다.

HTMLElement.itemValue Experimental

항목 값을 나타내는 Object 를 반환합니다.

HTMLElement.lang

요소의 속성, 텍스트, 컨텐츠의 언어를 나타내는 DOMString 입니다.

HTMLElement.noModule

임포트한 스크립트가 모듈 스크립트를 지원하는 유저 에이전트에서 실행될 수 있는지를 나타내는 Boolean 입니다.

HTMLElement.nonce (en-US)

주어진 페치(fetch)의 진행을 허용할지를 결정하기 위한 컨텐츠 보안 정책(Content Security Policy)에서 한 번 사용된 암호회된 숫자를 반환합니다.

HTMLElement.offsetHeight 읽기 전용 Experimental

레이아웃에 상대적인 요소의 높이를 갖는 double 을 반환합니다.

HTMLElement.offsetLeft읽기 전용 Experimental

요소의 left border 부터 offsetParent 의 left border 까지의 거리를 double 로 반환합니다.

HTMLElement.offsetParent읽기 전용 Experimental

모든 오프셋 계산이 현재 연산된 요소인 Element (en-US) 를 반환합니다.

HTMLElement.offsetTop (en-US)읽기 전용 Experimental

요소의 top border 부터 offsetParent 의 top border 까지의 거리를 double 로 반환합니다.

HTMLElement.offsetWidth (en-US)읽기 전용 Experimental

레이아웃에 상대적인 요소의 너비를 갖는 double 을 반환합니다.

HTMLElement.properties 읽기 전용 Experimental

HTMLPropertiesCollection… 을 반환합니다.

HTMLElement.spellcheck (en-US)

철자 검사를 제어하는 Boolean 입니다. 모든 HTML 요소에 존재하지만, 모두에 대해 적용되지는 않습니다.

HTMLElement.style (en-US)

요소의 스타일 속성의 정의를 나타내는 CSSStyleDeclaration (en-US) 객체입니다.

HTMLElement.tabIndex (en-US)

탭 순서에서 요소의 위치를 나타내는 long 입니다.

HTMLElement.title (en-US)

요소에 마우스를 오버할 때 팝업 상자에 표시되는 텍스트를 갖는 DOMString 입니다.

HTMLElement.translate (en-US) Experimental

번역을 나타내는 Boolean 입니다.

이벤트 핸들러

onXYZ 형태의 대부분의 이벤트 핸들러 속성은 GlobalEventHandlers 또는 TouchEventHandlers 에 정의되어 있으며 HTMLElement 에 의해 구현되었습니다. 다음 HTMLElement 에 해당하는 핸들러입니다.

HTMLElement.oncopy (en-US) 비표준

copy 이벤트를 위한 이벤트 핸들링 코드를 반환합니다(Firefox bug 280959).

HTMLElement.oncut (en-US) 비표준

cut 이벤트를 위한 이벤트 핸들링 코드를 반환합니다(Firefox bug 280959).

HTMLElement.onpaste (en-US) 비표준

paste 이벤트를 위한 이벤트 핸들링 코드를 반환합니다(Firefox bug 280959).

TouchEventHandlers.ontouchstart 비표준

touchstart (en-US) 이벤트를 위한 이벤트 핸들링 코드를 반환합니다.

TouchEventHandlers.ontouchend 비표준

touchend (en-US) 이벤트를 위한 이벤트 핸들링 코드를 반환합니다.

TouchEventHandlers.ontouchmove 비표준

touchmove (en-US) 이벤트를 위한 이벤트 핸들링 코드를 반환합니다.

TouchEventHandlers.ontouchenter 비표준

touchenter 이벤트를 위한 이벤트 핸들링 코드를 반환합니다.

TouchEventHandlers.ontouchleave 비표준

touchleave 이벤트를 위한 이벤트 핸들링 코드를 반환합니다.

TouchEventHandlers.ontouchcancel 비표준

touchcancel (en-US) 이벤트를 위한 이벤트 핸들링 코드를 반환합니다.

메서드

부모인 Element (en-US)의 메서드를 상속합니다.

HTMLElement.blur() (en-US)

현재 포커스된 요소로부터 키보드 포커스를 제거합니다.

HTMLElement.click()

요소로 마우스 클릭 이벤트를 전달합니다.

HTMLElement.focus() (en-US)

요소에 현재 키보드 포커스를 생성합니다.

HTMLElement.forceSpellCheck() (en-US) Experimental

요소에 철자 확인자를 생성합니다.

이벤트

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

invalid (en-US)

Fired when an element does not satisfy its constraints during constraint validation. Also available via the oninvalid (en-US) property.

Animation events

animationcancel (en-US)

Fired when an animation unexpectedly aborts. Also available via the onanimationcancel (en-US) property.

animationend (en-US)

Fired when an animation has completed normally. Also available via the onanimationend (en-US) property.

animationiteration (en-US)

Fired when an animation iteration has completed. Also available via the onanimationiteration (en-US) property.

animationstart (en-US)

Fired when an animation starts. Also available via the onanimationstart (en-US) property.

Input events

beforeinput (en-US)

Fired when the value of an <input> (en-US), <select> (en-US), or <textarea> (en-US) element is about to be modified.

input

Fired when the value of an <input> (en-US), <select> (en-US), or <textarea> (en-US) element has been changed. Also available via the oninput (en-US) property.

Pointer events

gotpointercapture (en-US)

Fired when an element captures a pointer using setPointerCapture() (en-US). Also available via the ongotpointercapture (en-US) property.

lostpointercapture (en-US)

Fired when a captured pointer (en-US) is released. Also available via the onlostpointercapture (en-US) property.

pointercancel (en-US)

Fired when a pointer event is canceled. Also available via the onpointercancel (en-US) property.

pointerdown (en-US)

Fired when a pointer becomes active. Also available via the onpointerdown (en-US) property.

pointerenter (en-US)

Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants. Also available via the onpointerenter (en-US) property.

pointerleave (en-US)

Fired when a pointer is moved out of the hit test boundaries of an element. Also available via the onpointerleave (en-US) property.

pointermove (en-US)

Fired when a pointer changes coordinates. Also available via the onpointermove (en-US) property.

pointerout (en-US)

Fired when a pointer is moved out of the hit test boundaries of an element (among other reasons). Also available via the onpointerout (en-US) property.

pointerover (en-US)

Fired when a pointer is moved into an element's hit test boundaries. Also available via the onpointerover (en-US) property.

pointerup (en-US)

Fired when a pointer is no longer active. Also available via the onpointerup (en-US) property.

Transition events

transitioncancel (en-US)

Fired when a CSS transition (en-US) is canceled. Also available via the ontransitioncancel (en-US) property.

transitionend (en-US)

Fired when a CSS transition (en-US) has completed. Also available via the ontransitionend (en-US) property.

transitionrun (en-US)

Fired when a CSS transition (en-US) is first created. Also available via the ontransitionrun property.

transitionstart (en-US)

Fired when a CSS transition (en-US) has actually started. Also available via the ontransitionstart property.

명세

Specification
HTML Standard
# htmlelement

브라우저 호환성

BCD tables only load in the browser

같이 보기