window.addEventListener('load', svgElementConvertImgToSvg); function svgElementConvertImgToSvg() { // Get all site images const images = document.querySelectorAll('a > img[src$=".svg"]'); images.forEach(img => { const parentAnchor = img.parentElement; fetch(img.src) .then(response => response.text()) .then(data => { // Create the new SVG element const parser = new DOMParser(); const parsedSvg = parser.parseFromString(data, 'image/svg+xml'); const svgElement = parsedSvg.documentElement; // Remove all