JSFiddle - React, Tailwind, and code Playground

by joshnicholson

HTML

<span id="finishedProduct">
<p>When you enter code, your finished product will be here! Don't worry, if you make a mistake you  can fix it later!</p>
</span>
<form name="userCode">
<textarea name="userCode" cols="90" rows="20" placeholder="Type your code here"></textarea></br>
<button type="button" id="btnRunCode">Run Code!</button>
</form>

JavaScript

var myButton = document.getElementById("btnRunCode");
myButton.addEventListener("click", makeCode);

function makeCode() {
var userCode=document.forms["userCode"]["userCode"].value;
document.getElementById('finishedProduct').innerHTML = userCode;
}