JSFiddle - React, Tailwind, and code Playground

by jmvidal

HTML

<h1>Hello</h1>
<input type="button" id="newpage" value="New Page"></input>

JavaScript

function newPage() {
    var w = window.open();
    w.document.open('text/html');
    w.document.write('<!DOCTYPE html><html><body><h1>New Page</h1></body></html>');
    w.document.close();
}

$('#newpage').click(newPage);