JSFiddle - React, Tailwind, and code Playground

HTML

<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>Document</title>
</head>
<script>
   function myprint() {
    const wnd = window.open('about:blank', '', '_blank, alwaysRaised=yes');
    wnd.document.write('<html><head><title></title>');
    wnd.document.write('</head><body>');
    wnd.document.write('<div>JavaScript often abbreviated as JS, is a high-level, interpreted programming language. It is a language which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm.</div>');
    wnd.document.write('<div class="print-header"><button title="Print" onclick="window.print()">Print</button></div>');
    wnd.document.write('</body></html>');
    wnd.document.close();
  }
</script>
<body>
   <button onclick="myprint()">Popup</button>
</body>