상세 컨텐츠

본문 제목

[Javascript]HTML DOM Events 목록(자바스크립트 이벤트 목록)

컴퓨터+IT

by 아르테미쓰 2023. 7. 18. 13:00

본문

[출처] https://www.w3schools.com/jsref/dom_obj_event.asp

 

 

HTML DOM Event Object

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

 

DOM 이벤트를 사용하면 JavaScript에서 이벤트 리스너 또는 이벤트 핸들러를 HTML 요소에 추가할 수 있습니다.

이벤트에 대한 자습서는 JavaScript 이벤트 자습서를 참조하세요.

[예제] HTML에서 onclick은 이벤트 리스너이고 myFunction은 이벤트 핸들러입니다.

<button onclick="myFunction()">Click me</button>

JavaScript에서 click은 이벤트이고 myFunction은 이벤트 핸들러입니다.

button.addEventListener("click", myFunction);

Event
Occurs When
Belongs To
The loading of a media is aborted
A page has started printing
A CSS animation has completed
A CSS animation is repeated
A CSS animation has started
A page is about to be printed
Before a document is about to be unloaded
An element loses focus
The browser can start playing a media (has buffered enough to begin)
The browser can play through a media without stopping for buffering
The content of a form element has changed
An element is clicked on
An element is right-clicked to open a context menu
The content of an element is copied
The content of an element is cutted
An element is double-clicked
An element is being dragged
Dragging of an element has ended
A dragged element enters the drop target
A dragged element leaves the drop target
A dragged element is over the drop target
Dragging of an element has started
A dragged element is dropped on the target
The duration of a media is changed
A media has reach the end ("thanks for listening")
An error has occurred while loading a file
An element gets focus
An element is about to get focus
An element is about to lose focus
An element is displayed in fullscreen mode
An element can not be displayed in fullscreen mode
There has been changes to the anchor part of a URL
An element gets user input
An element is invalid
A key is down
A key is pressed
A key is released
An object has loaded
Media data is loaded
Meta data (like dimensions and duration) are loaded
The browser starts looking for the specified media
A message is received through the event source
The mouse button is pressed over an element
The pointer is moved onto an element
The pointer is moved out of an element
The pointer is moved over an element
The pointer is moved onto an element
The pointer is moved out of an element
A user releases a mouse button over an element
mousewheel
Deprecated. Use the wheel event instead
The browser starts working offline
The browser starts working online
A connection with the event source is opened
User navigates away from a webpage
User navigates to a webpage
Some content is pasted in an element
A media is paused
The media has started or is no longer paused
The media is playing after beeing paused or buffered
popstate
The window's history changes
The browser is downloading media data
The playing speed of a media is changed
The document view is resized
A form is reset
An scrollbar is being scrolled
Something is written in a search field
Skipping to a media position is finished
Skipping to a media position is started
User selects some text
A <menu> element is shown as a context menu
The browser is trying to get unavailable media data
storage
A Web Storage area is updated
A form is submitted
The browser is intentionally not getting media data
The playing position has changed (the user moves to a different point in the media)
The user opens or closes the <details> element
The touch is interrupted
A finger is removed from a touch screen
A finger is dragged across the screen
A finger is placed on a touch screen
A CSS transition has completed
A page has unloaded
The volume of a media is changed (includes muting)
A media is paused but is expected to resume (e.g. buffering)
The mouse wheel rolls up or down over an element

[출처] https://www.w3schools.com/jsref/dom_obj_event.asp

 

관련글 더보기

댓글 영역