The DOMParser can also be used to parse a SVG document or a HTML document.
The DOMParser can also be used to parse a SVG document or a HTML document. There are three different results possible, selected by the MIME type given. If the MIME type is text/xml, the resulting object will be an XMLDocument, if the MIME type is image/svg+xml, it will be an SVGDocument and if the MIME type is text/html, it will be an HTMLDocument.
MDN
DOMParser can parse XML or HTML source stored in a string into a DOM Document.
MDN