dom "Browser Object Model" event and bom "Document Object Model" event are respectively: 1. 4 types of BOM events such as "load", "unload", "resize" and "scroll"; 2. There are 5 DOM events including "click", "mouseover" and "mouseout", "change", "submit", "keydown" and "keyup".
# Operating system for this tutorial: Windows 10 system, Dell G3 computer.
In web development, DOM events and BOM (Browser Object Model) events are two different concepts. Each of them represents a different event type.
DOM events (Document Object Model events)
DOM events are usually related to interaction with elements in web pages, including but not limited to:
- click: when the user clicks Event triggered when an element is clicked.
- mouseover and mouseout: Events triggered when the mouse moves over or out of an element.
- change: Event triggered when the value of a form element changes, such as input box content changes, drop-down list selection changes, etc.
- submit: Event triggered when the form is submitted.
- keydown and keyup: events triggered when the user presses or releases a keyboard key.
BOM events (Browser Object Model events)
BOM events are related to browser windows and documents, including:
- load: When the page is completely Events triggered after loading can be used to perform initialization operations.
- unload: Event triggered when the page is about to be unloaded, which can be used to perform cleanup operations.
- resize: Event triggered when the browser window size changes.
- scroll: Event triggered when the user scrolls the page.
In addition to the events listed above, there are many other DOM and BOM events available to developers. These events can be monitored through JavaScript and processed accordingly, thereby achieving rich interactive effects and user experience.
The above is the detailed content of What are DOM events and BOM events?. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn