DOMParser: DOMParser() constructor
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2016.
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
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
Specification |
---|
HTML Standard # dom-domparser-constructor-dev |
Browser compatibility
BCD tables only load in the browser