JSFiddle - React, Tailwind, and code Playground

HTML

<div id="scriptparent">
    <script id="myScript" type="text/javascript">
         alert($("#myScript").parent().attr("id"));
    </script>
</div>