In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly talks about "what are the events in html". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the events in html"?
Html events are: 1, Window events triggered by window objects; 2, Form events triggered by actions in the HTML form; 3, Keyboard events; 4, Mouse events triggered by mouse or similar user actions; 5, Media events triggered by media (such as video, image, and audio).
The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.
HTML has the ability to have events trigger actions in the browser, such as launching JavaScript when the user clicks on an element.
Events in html
1. Window event
Events triggered for window objects (applied to tags):
Property value describes the script that runs after the onafterprintscript document is printed. The script that runs before the onbeforeprintscript document is printed. The onbeforeunloadscript document uninstalls the script that was run before. The script that onerrorscript runs when the error occurs. A script that onhaschangescript runs when the document has changed. Triggered when the onloadscript page finishes loading. The script that onmessagescript runs when the message is triggered. Onofflinescript script that runs when the document is offline. The script that ononlinescript runs when the document is online. The script that onpagehidescript runs when the window is hidden. Onpageshowscript A script that runs when a window becomes visible. A script that onpopstatescript runs when the window history changes. Onredoscript the script that runs when the document executes redo. Onresizescript triggers when the browser window is resized. A script that onstoragescript runs after the Web Storage area is updated. The script that onundoscript runs when the document executes undo. Onunloadscript is triggered once the page has been downloaded (or the browser window has been closed).
2. Form event
Events triggered by actions within the HTML form (applied to almost all HTML elements, but most commonly in form elements):
Property value describes the script that runs when the onblurscript element loses focus. A script that onchangescript runs when the value of an element is changed. Oncontextmenuscript the script that runs when the context menu is triggered. Onfocusscript the script that runs when the element gets focus. The script that onformchangescript runs when the form changes. Onforminputscript the script that runs when the form gets user input. Oninputscript the script that runs when the element gets user input. Oninvalidscript script that runs when the element is invalid. Onresetscript triggers when the reset button in the form is clicked. Not supported in HTML5. Onselectscript is triggered after the text in the element is selected. Onsubmitscript triggers when the form is submitted.
3. Keyboard event
The property value describes that onkeydownscript is triggered when the user presses the key. Onkeypressscript is triggered when the user clicks the button. Onkeyupscript triggers when the user releases the button.
4. Mouse event
Events triggered by a mouse or similar user action:
Property value describes the trigger when a mouse click occurs on an onclickscript element. Triggered when a double click of the mouse occurs on the ondblclickscript element. The script that runs when the ondragscript element is dragged. The script that ondragendscript runs at the end of the drag operation. Ondragenterscript script that runs when an element element has been dragged to a valid drag-and-drop area. Ondragleavescript script that runs when an element leaves a valid drag-and-drop target. Ondragoverscript script that runs when an element is being dragged on a valid drag-and-drop target. The script that ondragstartscript runs at the beginning of the drag operation. Ondropscript script that runs when the dragged element is being dragged and dropped. Onmousedownscript triggers when the mouse button is pressed on the element. Onmousemovescript triggers when the mouse pointer moves over an element. Onmouseoutscript triggers when the mouse pointer moves out of the element. Onmouseoverscript triggers when the mouse pointer moves over an element. Onmouseupscript triggers when the mouse button is released on the element. Onmousewheelscript script that runs when the mouse wheel is being scrolled. Onscrollscript the script that runs when the element scroll bar is scrolled.
5. Media event
Events triggered by media (such as video, image, and audio) (applicable to all HTML elements, but common in media elements, such as,
, and):
Property value describes the script that onabortscript runs when it exits. Oncanplayscript script that runs when the file is ready to play (when the buffer is enough to start). Oncanplaythroughscript A script that runs when the media can be played to the end without being buffered. A script that ondurationchangescript runs when the length of the medium changes. Onemptiedscript A script that runs when a failure occurs and the file is suddenly unavailable (such as when the connection is disconnected unexpectedly). A script that onendedscript runs when the media has reached the end (can send messages such as "Thank you for watching"). Onerrorscript script that runs when an error occurs during file loading. A script that onloadeddatascript runs when the media data has been loaded. Onloadedmetadatascript A script that runs when metadata, such as resolution and duration, is loaded. A script that onloadstartscript runs before the file starts loading and no data is actually loaded. Onpausescript A script that runs when the media is paused by a user or program. Onplayscript script that runs when the media is ready to play. A script that onplayingscript runs when the media has started playing. Onprogressscript script that runs when the browser is fetching media data. A script that onratechangescript runs whenever the playback rate changes (for example, when the user switches to slow motion or fast forward mode). A script that onreadystatechangescript runs whenever the ready state changes (the ready state monitors the state of the media data). Onseekedscript script that runs when the seeking property is set to false (indicating that positioning has ended). Onseekingscript script that runs when the seeking property is set to true (indicating that the location is active). A script that onstalledscript runs when the browser fails to retrieve media data for whatever reason. A script that onsuspendscript runs when it terminates retrieving media data for whatever reason before the media data is fully loaded. Ontimeupdatescript A script that runs when the playback position changes, such as when the user fast-forward to a different location in the media. A script that onvolumechangescript runs whenever the volume changes, including setting the volume to mute. Onwaitingscript when the media has stopped playing but intends to continue to play (for example, when the media paused has buffered more data) to run the script here, I believe you have a better understanding of "what is the event in html", you might as well do it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.