DOMParser

open class DOMParser(source)

The DOMParser interface provides the ability to parse XML or HTML source code from a string into a DOM Document.

MDN Reference

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open external fun parseFromString(string: String, type: DOMParserSupportedType): Document
open external fun parseFromString(string: TrustedHTML, type: DOMParserSupportedType): Document

The parseFromString() method of the DOMParser interface parses an input containing either HTML or XML, returning a Document with the type given in the contentType property.