Is there a way in jQuery to extract SVG data from a div within an HTML page and insert it into a CSS background-image URL? Rather than loading an external SVG file, I want the HTML file to be completely self-contained. Here's what I have been attempting:
var svgData = $("#div-containing-svg").html()
$("other-div").css({backgroundImage:svgData});
Can this be done? And if so, will it function consistently across different browsers?