The DOMParser interface provides the ability to parse XML or HTML source code from a string into a DOM Document.
You can perform the opposite operation — converting a DOM tree into XML or HTML source — using the XMLSerializer interface.
In the case of an HTML document, you can also replace portions of the DOM with new DOM trees built from HTML by setting the value of the Element.innerHTML and outerHTML properties. These properties can also be read to fetch HTML fragments corresponding to the corresponding DOM subtree.
Note that XMLHttpRequest can parse XML and HTML directly from a URL-addressable resource, returning a Document in its response property.
iconSprite is assigned a value returned by DOMParser.documentElement. parseFromString accepts ICONS that is imported from packages/scan/src/web/assets/svgs/svgs.ts.
Now then, this svgs.ts has ICONS variable that contains svg as string as shown below
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.