JSFiddle - React, Tailwind, and code Playground

by gryzzly

HTML

<button>Open</button>

JavaScript

var button = document.querySelector('button');

button.addEventListener('click', function (e) {
    e.preventDefault();
    window.open('http://fiddle.jshell.net/gryzzly/h3646/show/light/');
}, false);

// The contents of the fiddle that opens in new window
// alert('whoa');
// alert('whee');
// window.onload = window.close;

// The window onload event fires once all the code in the page has been parsed – therefore you can run any code, attach function to onload and be sure to have that code executed!