HTML parser

The part of the browser that reads HTML text and builds the DOM tree from it, one token at a time.

In more detail

Parsing runs in stages: bytes are decoded into characters, a tokenizer turns characters into tokens, and a tree builder turns tokens into DOM nodes. The HTML parser never gives up on bad markup; the standard defines exactly how every error is repaired. A synchronous script tag pauses the parser until the script has downloaded and run.

Related terms

Taught in

References