JSFiddle - React, Tailwind, and code Playground
by koh_edwin
HTML
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<svg id="t">
<g>
</g>
</svg>
<script>
var s = document.getElementById('t');
var g = s.childNodes[1];
var foreign = document.createElementNS
('http://www.w3.org/2000/svg',"foreignObject");
foreign.setAttribute('width', 500);
foreign.setAttribute('height',500);
var iDiv = document.createElement('div');
var ob = document.createTextNode("<h1>xxxx</h1>");
iDiv.appendChild(ob);
foreign.appendChild(iDiv);
g.appendChild(foreign);
</script>
</body>
</html>