JSFiddle - React, Tailwind, and code Playground

HTML

<div><textarea></textarea></div><div><iframe id="results"></iframe></div>

CSS

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin : 0;
    padding: 0;
}

div {
    height: 100%;
    position: relative;
    display: inline-block;
    width: 50%;
}

textarea, iframe {
    position: absolute;
    margin: 0;
    padding: 0;
    width: 100%;
}

textarea, iframe {
    height: 100%;
}

JavaScript

document.querySelector('textarea').addEventListener('input', function(){
    document.getElementById('results').contentWindow.document.body.innerHTML = this.value;
});