Create SVG, set href instead of xlink:href in pure Javascript
I have an SVG sprite with all my icons, and when dinamically adding an icon in Javascript I use thise code: let closeButton = document.createElementNS("http://www.w3.org/2000/svg", "svg"); let svgUse = document.createElementNS('http://www.w3.org/2000/svg', 'use'); svgUse.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'css/sprite.svg#warning'); closeButton.append(svgUse); I think can understand straight…