JSFiddle - React, Tailwind, and code Playground

HTML

<div>
<svg></svg>
</div>

JavaScript

$(function() {
    $('svg').append('<rect top="20" left="20" height="10" width="10" style="fill: #ff00ff" />');
});
console.log($('div')[0].innerHTML);