Home  >  Article  >  What are DOM events and BOM events?

What are DOM events and BOM events?

尊渡假赌尊渡假赌尊渡假赌
尊渡假赌尊渡假赌尊渡假赌Original
2023-11-13 10:47:001022browse

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".

What are DOM events and BOM events?

# 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:

  1. click: when the user clicks Event triggered when an element is clicked.
  2. mouseover and mouseout: Events triggered when the mouse moves over or out of an element.
  3. change: Event triggered when the value of a form element changes, such as input box content changes, drop-down list selection changes, etc.
  4. submit: Event triggered when the form is submitted.
  5. 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:

  1. load: When the page is completely Events triggered after loading can be used to perform initialization operations.
  2. unload: Event triggered when the page is about to be unloaded, which can be used to perform cleanup operations.
  3. resize: Event triggered when the browser window size changes.
  4. 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