JSFiddle - React, Tailwind, and code Playground

by nniicc

HTML

<svg height="249" width="336" xmlns="http://www.w3.org/2000/svg" style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Arial, Helvetica, sans-serif;font-size:12px;" version="1.1"><desc>Created with Highcharts 4.1.8</desc><defs><clipPath id="highcharts-55"><rect height="291" width="143" y="0" x="0"></rect></clipPath></defs><rect class=" highcharts-background" fill="#FFFFFF" strokeWidth="0" height="249" width="336" y="0" x="0"></rect><g zIndex="1" class="highcharts-grid"><path opacity="1" zIndex="1" stroke-width="1" stroke="#D8D8D8" d="M 34.5 47 L 34.5 190" fill="none"></path><path opacity="1" zIndex="1" stroke-width="1" stroke="#D8D8D8" d="M 107.5 47 L 107.5 190" fill="none"></path><path opacity="1" zIndex="1" stroke-width="1" stroke="#D8D8D8" d="M 180.5 47 L 180.5 190" fill="none"></path><path opacity="1" zIndex="1" stroke-width="1" stroke="#D8D8D8" d="M 252.5 47 L 252.5 190" fill="none"></path><path opacity="1" zIndex="1" stroke-width="1" stroke="#D8D8D8" d="M 326.5 47 L 326.5 190" fill="none"></path></g><g zIndex="1" class="highcharts-grid"></g><g zIndex="2" class="highcharts-axis"><text y="230" visibility="visible" style="color:#707070;fill:#707070;" class=" highcharts-yaxis-title" transform="translate(0,0)" text-anchor="middle" zIndex="7" x="180.5">Values</text></g><g zIndex="2" class="highcharts-axis"><path opacity="1" stroke-width="1" stroke="#C0D0E0" d="M 35 76.5 L 25 76.5" fill="none"></path><path opacity="1" stroke-width="1" stroke="#C0D0E0" d="M 35 104.5 L 25 104.5" fill="none"></path><path opacity="1" stroke-width="1" stroke="#C0D0E0" d="M 35 133.5 L 25 133.5" fill="none"></path><path opacity="1" stroke-width="1" stroke="#C0D0E0" d="M 35 161.5 L 25 161.5" fill="none"></path><path opacity="1" stroke-width="1" stroke="#C0D0E0" d="M 35 190.5 L 25 190.5" fill="none"></path><path opacity="1" stroke-width="1" stroke="#C0D0E0" d="M 35 46.5 L 25 46.5" fill="none"></path><path visibility="visible" zIndex="7" stroke-width="1"...

JavaScript

var svg = $("svg");

var img = document.createElement('img');
img.setAttribute('src', 'data:image/svg+xml;base64,' + btoa(unescape(encodeURIComponent(svg.parent().html()))));
console.log(img);

$("body").append(img);