PS: This table summarizes and analyzes various commonly used JavaScript events, including mouse events, load events, scroll events, form events, edit events, and data binding events. It lists the event names, their browser support, and descriptions of their functions.
一般事件
A total of 10 types.
Event
Browser support
Commentary
onclick
IE3、N2
This event is triggered when the mouse is clicked.
ondblclick
IE4、N4
Double-clicking the mouse triggers this event.
onmousedown
IE4、N4
Trigger this event when the mouse button is pressed.
onmouseup
IE4、N4
This event is triggered when the mouse is pressed and released.
onmouseover
IE3、N2
This event is triggered when the mouse is moved over the top of an object range.
onmousemove
IE4、N4
This event is triggered when the mouse moves.
onmouseout
IE4、N3
This event is triggered when the mouse leaves the range of an object.
onkeypress
IE4、N4
An event is triggered when a key on the keyboard is pressed and released.
onkeydown
IE4、N4
An event is triggered when a key on the keyboard is pressed.
onkeyup
IE4、N4
An event is triggered when a key on the keyboard is pressed and released.
页面相关事件
A total of 9 types
Event
Browser support
Commentary
onabort
IE4、N3
Image download was interrupted by the user.
onbeforeunload
IE4、N
This event is triggered when the content of the current page is about to change.
onerror
IE4、N3
Trigger this event when an error occurs.
onload
IE3、N2
This event triggers when the page content is completed.
onmove
IE、N4
This event is triggered when the browser window is moved.
onresize
IE4、N4
This event is triggered when the browser window size is changed.
onscroll
IE4、N
The event is triggered when the scrollbar position in the browser changes.
onstop
IE5、N
The event is triggered when the browser's stop button is pressed or a downloading file is interrupted.
onunload
IE3、N2
This event is triggered when the current page is changed.
表单相关事件
A total of 5 types
Event
Browser support
Commentary
onblur
IE3、N2
This event is triggered when the current element loses focus.
onchange
IE3、N2
The event is triggered when the current element loses focus and its content changes.
onfocus
IE3 、N2
This event is triggered when an element gains focus.
onreset
IE4 、N3
The event is triggered when the RESET attribute of the form is activated.
onsubmit
IE3 、N2
A form submission triggers this event.
滚动字幕事件
A total of 3 types
Event
Browser support
Commentary
onbounce
IE4、N
Content moving out of Marquee display range triggers this event.
onfinish
IE4、N
When the Marquee element finishes displaying the required content, this event is triggered.
onstart
IE4、 N
The event is triggered when the Marquee element starts displaying content.
编辑事件
A total of 20 types
Event
Browser support
Commentary
onbeforecopy
IE5、N
This event is triggered before the currently selected content on the page is to be copied to the browser's clipboard.
onbeforecut
IE5、 N
This event is triggered when part or all of the content on the page is to be [cut] and moved to the browser's clipboard.
onbeforeeditfocus
IE5、N
The current element is about to enter edit mode.
onbeforepaste
IE5、 N
This event is triggered when content is to be transferred [pasted] from the browser's clipboard to the page.
onbeforeupdate
IE5、 N
Notify the target object when the browser pastes content from the system clipboard.
oncontextmenu
IE5、N
The event triggered when the browser's right-click menu appears or the page menu is triggered by a keyboard key.
oncopy
IE5、N
This event is triggered after the currently selected content on the page is copied.
oncut
IE5、N
This event is triggered when the currently selected content on the page is cut.
ondrag
IE5、N
An event triggered when an object is dragged [Action Event]
ondragdrop
IE、N4
An external object is dragged into the current window or frame.
ondragend
IE5、N
The event is triggered when the mouse drag ends, i.e., the mouse button is released.
ondragenter
IE5、N
The event is triggered when the object being dragged by the mouse enters the container's range.
ondragleave
IE5、N
The event is triggered when the object being dragged by the mouse leaves its container's range.
ondragover
IE5、N
An event is triggered when a dragged object is within the container range of another object.
ondragstart
IE4、N
This event is triggered when an object is being dragged.
ondrop
IE5、N
During a drag operation, this event is triggered when the mouse button is released.
onlosecapture
IE5、N
This event is triggered when an element loses the selection focus due to mouse movement.
onpaste
IE5、N
This event is triggered when content is pasted.
onselect
IE4、N
Event when text content is selected
onselectstart
IE4、N
Event triggered when the text content selection is about to start
数据绑定
A total of 10 types.
Event
Browser support
Commentary
onafterupdate
IE4、N
This event is triggered when data is completed from the data source to the object.
oncellchange
IE5、N
When the data source changes.
ondataavailable
IE4、N
An event is triggered when the data is received.
ondatasetchanged
IE4、N
Data change event triggered when data source changes
ondatasetcomplete
IE4、N
This event is triggered when all valid data from the coming data source has been read.
onerrorupdate
IE4、N
When data transmission is canceled by triggering the onBeforeUpdate event, instead of using onAfterUpdate event.
onrowenter
IE5、N
Event triggered when the current data source changes and new valid data is available.
onrowexit
IE5、N
Event triggered when the current data source is about to change.
onrowsdelete
IE5、N
This event is triggered when the current data record is about to be deleted.
onrowsinserted
IE5、N
This event is triggered when the current data source is about to insert a new record.
外部事件
A total of 6 types.
Event
Browser support
Commentary
onafterprint
IE5、N
This event is triggered after the document is printed.
onbeforeprint
IE5、N
This event is triggered when the document is about to be printed.
onfilterchange
IE4、N
Event triggered when a filter effect of an object changes.
onhelp
IE4、N
This event is triggered when the browser's F1 key is pressed or the help option is selected.
onpropertychange
IE5、N
An event is triggered when one of an object's properties changes.
onreadystatechange
IE4、N
An event is triggered when the initialization property value of an object changes.