DOMParser - Web APIs | MDN

Constructor

DOMParser()

Creates a new DOMParser object.

Instance methods

DOMParser.parseFromString()

Parses an input TrustedHTML instance or string as HTML or XML and returns a Document.

Examples

The documentation for DOMParser.parseFromString(), this interface's only method, contains examples for parsing XML, SVG, and HTML strings.

Specifications

Specification
HTML
# dom-parsing-and-serialization

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.