JSFiddle - React, Tailwind, and code Playground

HTML

<button onclick="myFunction()">Try it</button>
<div class="content">Show this div inside the pop up window.</div>

CSS

.content {
    display:none;
}

JavaScript

function myFunction() {
    var myWindow = window.open("", "MsgWindow", "width=200, height=100");

    myWindow.document.write($(".content").html());
    myWindow.document.close();

}