JSFiddle - React, Tailwind, and code Playground

by Twisty

HTML

<p>Click the button to create.</p>

<div id="myDIV">
  A DIV element
</div>

<button onclick="insertMessage()">Try it</button>
<script>
  function insertMessage(msg) {
    var tlkio = document.createElement("div");
    tlkio.style.width = "100%";
    tlkio.style.height = "400px";
    tlkio.setAttribute('data-channel', 'regerhtrh');
    tlkio.setAttribute('data-theme', 'theme--night');

    var tlkScript = document.createElement("script");
    tlkScript.src = 'https://tlk.io/embed.js';
    tlkScript.type = 'text/javascript';
    tlkScript.setAttribute('async', 'async');

    document.getElementById('myDIV').append(tlkio, tlkScript);
  }

</script>

CSS

#myDIV {
  border: 1px solid black;
  margin-bottom: 10px;
}