Event 대상
Event 대상
DOM에서의 모든 이벤트 객체는 Event 객체를 기반으로 합니다.
따라서, 모든 다른 이벤트 객체(예를 들어 MouseEvent 과 KeyboardEvent)은 Event 객체의 속성과 메서드에 접근할 수 있습니다.
이벤트 속성과 메서드
속성/메서드 | 설명 |
---|---|
bubbles | 특정 이벤트가 퍼블리시ング 이벤트인지 반환합니다. |
cancelBubble | 이벤트가 어느 층위에서 전파되어야 하는지 설정하거나 반환합니다. |
cancelable | 이벤트가 기본 작업을 방지할 수 있는지 반환합니다. |
composed | 이 이벤트가 Shadow DOM에서 일반 DOM으로 전달될 수 있는지 표시합니다. |
composedPath() | 이벤트 경로를 반환합니다. |
createEvent() | 새 이벤트를 생성합니다. |
currentTarget | 이벤트 리스너가 트리거한 요소를 반환합니다. |
defaultPrevented | preventDefault() 메서드를 호출했는지 여부를 반환합니다. |
eventPhase | 이벤트 흐름이 현재 평가되고 있는 단계를 반환합니다. |
isTrusted | 이벤트가 신뢰할 수 있는지 반환합니다. |
preventDefault() | 이벤트가 취소될 수 있으면 취소하고 이벤트에 대한 기본 작업을 수행하지 않습니다. |
stopImmediatePropagation() | 이벤트의 다른 리스너가 호출되지 않도록 합니다. |
stopPropagation() | 이벤트가 이벤트 흐름에서 더 이상 전파되지 않도록 합니다. |
target | 이벤트를 트리거한 요소를 반환합니다. |
timeStamp | 기원에 대한 시간을 밀리초로 반환합니다. |
type | 이벤트 이름을 반환합니다. |
이벤트 유형
이 이벤트 유형은 Event 객체에 속합니다:
이벤트 | 설명 |
---|---|
abort | 미디어 로드가 중지될 때 이 이벤트가 발생합니다. |
afterprint | 페이지가 인쇄를 시작하거나 인쇄 대화 상자를 닫을 때 이 이벤트가 발생합니다. |
beforeprint | This event occurs when the page is about to be printed. |
beforeunload | This event occurs before the document is unloaded. |
canplay | This event occurs when the browser can start playing media. |
canplaythrough | This event occurs when the browser can play media without stopping buffering. |
change | This event occurs when the content of the form element, the selected content, or the selected state changes. |
error | This event occurs after an error occurs when loading an external file. |
fullscreenchange | This event occurs when the element is displayed in full-screen mode. |
fullscreenerror | This event occurs when the element cannot be displayed in full-screen mode. |
input | This event occurs when the element receives user input. |
invalid | This event occurs when the element is invalid. |
load | This event occurs when the object is loaded. |
loadeddata | This event occurs after the media data is loaded. |
loadedmetadata | This event occurs when metadata (such as size and duration) is loaded. |
message | This event occurs when a message is received through this event source. |
offline | This event occurs when the browser starts working offline. |
online | This event occurs when the browser starts working online. |
open | This event occurs when a connection to the event source is opened. |
pause | This event occurs when the media is paused by the user or paused programmatically. |
play | This event occurs when the media has started or is no longer paused. |
playing | This event occurs when the media is paused or stopped to buffer and then played back. |
progress | This event occurs when the browser is in the process of obtaining media data. |
ratechange | This event occurs when the playback speed of the media changes. |
resize | This event occurs when the size of the document view is adjusted. |
reset | This event occurs when the form is reset. |
scroll | This event occurs when the scrollbar of a scrolling element is scrolled. |
search | When the user enters content in the search field, this event occurs. |
seeked | When the user finishes moving/jumping to a new position in the media, this event occurs. |
seeking | When the user starts moving/jumping to a new position in the media, this event occurs. |
select | When the text is selected by the user (for <input> and <textarea>), this event occurs |
show | when the <menu> element is displayed as a context menu, this event occurs. |
stalled | 브라우저가 미디어 데이터를 가져오려고 했지만 데이터가 사용할 수 없을 때 이 이벤트가 발생합니다. |
submit | 양식을 제출할 때 이 이벤트가 발생합니다. |
suspend | 브라우저가 의도적으로 미디어 데이터를 가져오지 않을 때 이 이벤트가 발생합니다. |
timeupdate | 플레이 위치가 변경될 때 이 이벤트가 발생합니다. |
toggle | 사용자가 <details> 요소를 열거나 닫을 때 이 이벤트가 발생합니다. |
unload | 페이지가 다운로드되면 (body에 대해), 이 이벤트가 발생합니다. |
waiting | 미디어가 일시 중지되었지만 다시 시작할 예정인 경우 이 이벤트가 발생합니다. |