JSFiddle - React, Tailwind, and code Playground
HTML
<p>
Using HTML and img tag: <br/>
<div id="htmlEmbed"></div>
</p>
<p>
Using SVG and img tag: <br/>
<svg id="svgEmbed"></svg>
</p>
<object id="E" type="image/svg+xml" data="https://raw.githubusercontent.com/digininja/svg_xss/master/xss.svg" width="320" height="240">
<param name="src" value="https://raw.githubusercontent.com/digininja/svg_xss/master/xss.svg">
</object>
JavaScript
d3.select("#htmlEmbed").append("img")
.attr("src","")
.attr("width", 100)
.attr("height", 100)
d3.select("#svgEmbed").append("image")
.attr("xlink:href","https://upload.wikimedia.org/wikipedia/commons/d/d8/Compass_card_(de).svg")
.attr("width", 100)
.attr("height", 100)