JSFiddle - React, Tailwind, and code Playground

HTML

<body>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  <script>
    function myFunction() {
      var childWindow = window.open("", "childWindow", "width=200,height=100");
      var script = childWindow.document.createElement("script");
      script.innerHTML = 'if (typeof(jQuery) == "undefined") { window.jQuery = function(selector) { return window.opener.jQuery(selector, document);};jQuery = window.opener.$.extend(jQuery,window.opener.$);window.$ = jQuery;var msg = "Created with jQuery!";$("body").append(\'<button onclick="alert(msg)">Text</button>\');}';
      childWindow.document.getElementsByTagName("head")[0].appendChild(script);
    }

  </script>
  <p>Click to test child window jQuery injection.</p>

  <button onclick="myFunction()">Try it</button>
</body>