JSFiddle - React, Tailwind, and code Playground

by Cameron Bernhardt

HTML

<textarea id="myTextBox"></textarea>
<br/>
<input type="button" name="Button" value="Click Me" onclick="substitute();">

JavaScript

function substitute() {
    var myVal = document.getElementById('myTextBox').value;
    if (myVal.length == 0) {
        alert('Empty Textbox');
    }
}