Back to Content

DOMParser: DOMParser() constructor

files/en-us/web/api/domparser/domparser/index.md

latest530 B
Original Source

{{APIRef("DOM")}}

The DOMParser() constructor creates a new DOMParser object. This object can be used to parse the text of a document using the parseFromString() method.

Syntax

js-nolint
new DOMParser()

Parameters

None.

Return value

A new DOMParser object. This object can be used to parse the text of a document using the parseFromString() method.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}