HTMLElement
인터페이스는 모든 종류의 HTML 요소를 나타냅니다. 일부 요소는 이 인터페이스를 직접 구현하지만 나머지 요소는 HTMLElement
를 상속한 자식 인터페이스를 구현합니다.
속성
부모인 Element
의 속성을 상속합니다. GlobalEventHandlers
, TouchEventHandlers
의 속성을 구현합니다.
HTMLElement.accessKey
- 요소에 할당된 접근 키를 나타내는
DOMString
입니다. HTMLElement.accessKeyLabel
Read only- 요소에 할당된 접근 키를 포함하는
DOMString
을 반환합니다. HTMLElement.contentEditable
- 요소가 수정 가능하면
"true"
, 그렇지 않으면"false"
값을 갖는DOMString
입니다. HTMLElement.isContentEditable
Read only- 요소의 콘텐츠가 수정 가능한지 여부를 나타내는
Boolean
을 반환합니다. HTMLElement.contextMenu
- 요소와 관련된 콘텍스트 메뉴를 나타내는
HTMLMenuElement
입니다.null
일 수 있습니다. HTMLElement.dataset
Read only- 요소의 사용자 지정 데이터 속성(
data-*
)을 스크립트에서 읽고 쓸 수 있는DOMStringMap
을 반환합니다. HTMLElement.dir
- 요소의 방향성을 표현하는 전역 속성
dir
을 나타내는DOMString
을 반환합니다. 가능한 값은"ltr"
,"rtl"
,"auto"
입니다. HTMLElement.draggable
- 요소가 드래그 가능한지 여부를 나타내는
Boolean
을 반환합니다. HTMLElement.dropzone
Read onlydropzone
전역 속성을 나타내고 drop 작업에 대한 동작을 설명하는DOMSettableTokenList
를 반환합니다.HTMLElement.hidden
- 요소가 숨김상태인지 여부를 나타내는
Boolean
을 반환합니다. HTMLElement.inert
- 유저 에이전트가 사용자 인터렉션 이벤트, 페이지 내 텍스트 검색("페이지에서 찾기"), 텍스트 선택의 목적으로 주어진 노드가 없는 것처럼 동작해야하는지 여부를 나타내는
Boolean
을 반환합니다. HTMLElement.innerText
- 노드와 그 자손의 "렌더링된" 텍스트 컨텐츠를 나타냅니다. getter 로써, 이는 사용자가 커서로 요소의 컨텐츠를 하이라이팅한 후 클립보드로 복사하면 얻을 수 있는 텍스트와 유사합니다.
HTMLElement.itemScope
- 항목 스코프를 나타내는
Boolean
입니다. HTMLElement.itemType
Read onlyDOMSettableTokenList
… 를 반환합니다.HTMLElement.itemId
- 항목 ID 를 나타내는
DOMString
입니다. HTMLElement.itemRef
Read onlyDOMSettableTokenList
… 를 반환합니다.HTMLElement.itemProp
Read onlyDOMSettableTokenList
… 를 반환합니다.HTMLElement.itemValue
- 항목 값을 나타내는
Object
를 반환합니다. HTMLElement.lang
- 요소의 속성, 텍스트, 컨텐츠의 언어를 나타내는
DOMString
입니다. HTMLElement.noModule
- 임포트한 스크립트가 모듈 스크립트를 지원하는 유저 에이전트에서 실행될 수 있는지를 나타내는
Boolean
입니다. HTMLElement.nonce
- 주어진 페치(fetch)의 진행을 허용할지를 결정하기 위한 컨텐츠 보안 정책(Content Security Policy)에서 한 번 사용된 암호회된 숫자를 반환합니다.
HTMLElement.offsetHeight
Read only- 레이아웃에 상대적인 요소의 높이를 갖는
double
을 반환합니다. HTMLElement.offsetLeft
Read only- 요소의 left border 부터
offsetParent
의 left border 까지의 거리를double
로 반환합니다. HTMLElement.offsetParent
Read only- 모든 오프셋 계산이 현재 연산된 요소인
Element
를 반환합니다. HTMLElement.offsetTop
Read only- 요소의 top border 부터
offsetParent
의 top border 까지의 거리를double
로 반환합니다. HTMLElement.offsetWidth
Read only- 레이아웃에 상대적인 요소의 너비를 갖는
double
을 반환합니다. HTMLElement.properties
Read onlyHTMLPropertiesCollection
… 을 반환합니다.HTMLElement.spellcheck
- 철자 검사를 제어하는
Boolean
입니다. 모든 HTML 요소에 존재하지만, 모두에 대해 적용되지는 않습니다. HTMLElement.style
- 요소의 스타일 속성의 정의를 나타내는
CSSStyleDeclaration
객체입니다. HTMLElement.tabIndex
- 탭 순서에서 요소의 위치를 나타내는
long
입니다. HTMLElement.title
- 요소에 마우스를 오버할 때 팝업 상자에 표시되는 텍스트를 갖는
DOMString
입니다. HTMLElement.translate
- 번역을 나타내는
Boolean
입니다.
이벤트 핸들러
onXYZ
형태의 대부분의 이벤트 핸들러 속성은 GlobalEventHandlers
또는 TouchEventHandlers
에 정의되어 있으며 HTMLElement
에 의해 구현되었습니다. 다음 HTMLElement
에 해당하는 핸들러입니다.
HTMLElement.oncopy
copy
이벤트를 위한 이벤트 핸들링 코드를 반환합니다(bug 280959).HTMLElement.oncut
cut
이벤트를 위한 이벤트 핸들링 코드를 반환합니다(bug 280959).HTMLElement.onpaste
paste
이벤트를 위한 이벤트 핸들링 코드를 반환합니다(bug 280959).TouchEventHandlers.ontouchstart
touchstart
이벤트를 위한 이벤트 핸들링 코드를 반환합니다.TouchEventHandlers.ontouchend
touchend
이벤트를 위한 이벤트 핸들링 코드를 반환합니다.TouchEventHandlers.ontouchmove
touchmove
이벤트를 위한 이벤트 핸들링 코드를 반환합니다.TouchEventHandlers.ontouchenter
touchenter
이벤트를 위한 이벤트 핸들링 코드를 반환합니다.TouchEventHandlers.ontouchleave
touchleave
이벤트를 위한 이벤트 핸들링 코드를 반환합니다.TouchEventHandlers.ontouchcancel
touchcancel
이벤트를 위한 이벤트 핸들링 코드를 반환합니다.
메서드
부모인 Element
의 메서드를 상속합니다.
HTMLElement.blur()
- 현재 포커스된 요소로부터 키보드 포커스를 제거합니다.
HTMLElement.click()
- 요소로 마우스 클릭 이벤트를 전달합니다.
HTMLElement.focus()
- 요소에 현재 키보드 포커스를 생성합니다.
HTMLElement.forceSpellCheck()
- 요소에 철자 확인자를 생성합니다.
이벤트
Listen to these events using addEventListener()
or by assigning an event listener to the oneventname
property of this interface.
Animation events
animationcancel
- Fired when an animation unexpectedly aborts.
Also available via theonanimationcancel
property. animationend
- Fired when an animation has completed normally.
Also available via theonanimationend
property. animationiteration
- Fired when an animation iteration has completed.
Also available via theonanimationiteration
property. animationstart
- Fired when an animation starts.
Also available via theonanimationstart
property.
Input events
beforeinput
- Fired when the value of an
<input>
,<select>
, or<textarea>
element is about to be modified. input
- Fired when the
value
of an<input>
,<select>
, or<textarea>
element has been changed.
Also available via theoninput
property.
Pointer events
gotpointercapture
- Fired when an element captures a pointer using
setPointerCapture()
.
Also available via theongotpointercapture
property. lostpointercapture
- Fired when a captured pointer is released.
Also available via theonlostpointercapture
property. pointercancel
- Fired when a pointer event is canceled.
Also available via theonpointercancel
property. pointerdown
- Fired when a pointer becomes active.
Also available via theonpointerdown
property. pointerenter
- Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants.
Also available via theonpointerenter
property. pointerleave
- Fired when a pointer is moved out of the hit test boundaries of an element.
Also available via theonpointerleave
property. pointermove
- Fired when a pointer changes coordinates.
Also available via theonpointermove
property. pointerout
- Fired when a pointer is moved out of the hit test boundaries of an element (among other reasons).
Also available via theonpointerout
property. pointerover
- Fired when a pointer is moved into an element's hit test boundaries.
Also available via theonpointerover
property. pointerup
- Fired when a pointer is no longer active.
Also available via theonpointerup
property.
Transition events
transitioncancel
- Fired when a CSS transition is canceled.
Also available via theontransitioncancel
property. transitionend
- Fired when a CSS transition has completed.
Also available via theontransitionend
property. transitionrun
- Fired when a CSS transition is first created.
Also available via theontransitionrun
property. transitionstart
- Fired when a CSS transition has actually started.
Also available via theontransitionstart
property.
명세
명세 | 상태 | 코멘트 |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'HTMLElement' in that specification. |
Working Draft | 다음 속성들이 추가됨: offsetParent , offsetTop , offsetLeft , offsetWidth , offsetHeight . |
HTML Living Standard The definition of 'HTMLElement' in that specification. |
Living Standard | 다음 속성들이 추가됨: translate , itemScope , itemType , itemId , itemRef , itemProp , properties , itemValue .다음 메소드가 추가됨: forceSpellcheck() .onXYZ 속성을 GlobalEventHandlers 인터페이스로 이동하고 이로부터 상속을 추가함. |
HTML5 The definition of 'HTMLElement' in that specification. |
Recommendation | 다음 속성들이 추가됨: dataset , hidden , tabindex , accessKey , accessKeyLabel , draggable , dropzone , contentEditable , isContentEditable , contextMenu , spellcheck , commandType , commandLabel , commandIcon , commandHidden , commandDisabled , commandChecked , style , 모든 onXYZ 속성들.id 와 className 속성을 Element 인터페이스로 이동함. |
Document Object Model (DOM) Level 2 HTML Specification The definition of 'HTMLElement' in that specification. |
Obsolete | Document Object Model (DOM) Level 2 HTML Specification 으로부터 변경 사항 없음 |
Document Object Model (DOM) Level 1 Specification The definition of 'HTMLElement' in that specification. |
Obsolete | 초기 정의. |
브라우저 호환성
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.