Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const renderSVG = function () {
- let container = document.querySelectorAll('.lpc-features-8__features-icon-inner');
- if (!!container) { // since You want to check existence of elements
- for (let i = 0; i < container.length; i++) {
- const element = container[i];
- let svg = element.querySelector('svg');
- const XML = new XMLSerializer().serializeToString(svg);
- const SVG64 = btoa(XML);
- const img = new Image();
- img.src = 'data:image/svg+xml;base64,' + SVG64;
- svg.remove();
- element.appendChild(img);
- }
- }
- };
- renderSVG();
Add Comment
Please, Sign In to add comment