JSFiddle - React, Tailwind, and code Playground

HTML

<div id="example">
  <script>
    (function () {
        var scripts = document.getElementsByTagName('script'),
            myScript = scripts[scripts.length - 1]

        console.log(myScript.parentNode.getAttribute('id')); 
     })();
  
</script>

</div>