parseFromString method

Document parseFromString(
  1. JSAny string,
  2. DOMParserSupportedType type
)

The parseFromString() method of the DOMParser interface parses a string containing either HTML or XML, returning an HTMLDocument or an XMLDocument.

Note: The Document.parseHTMLUnsafe() static method provides an ergonomic alternative for parsing HTML strings into a Document.

Implementation

external Document parseFromString(
  JSAny string,
  DOMParserSupportedType type,
);