HTML - (Document) Parser

Parsing

HTML documents consist of a tree of elements and text. The specification defines a set of elements that can be used in HTML, along with rules.

If a document is transmitted with the text/html mime type, then it will be processed as an HTML document by Web browsers.

HTML user agents (e.g. Web browsers) parse the markup, turning it into a DOM (Document Object Model) tree.

HTML documents represent a media-independent description of interactive content. (screen, speech synthesizer, braille display). By using a language such as CSS, the authors can influence the rendering.

Parsing of HTML files happens asynchronously and incrementally, meaning that the parser can pause at any point to let scripts run.

Regexp

You can't parse [X]HTML with regex. Because HTML can't be parsed by regex

Library

Documentation / Reference





Discover More
DOM - Load event (onload, load listener)

The load event is an event that is fired / emitted on: an HTML element that fetch resources on the browser window when the page has finish loading. This event is a timing page load event To...
Devtool Chrome Event Listener
Event - Missed Event

Parsing of HTML files happens synchronously and incrementally, meaning that the parser can pause at any point to let scripts run. It does mean that authors need to be careful to avoid hooking event handlers...



Share this page:
Follow us:
Task Runner