JSFiddle - React, Tailwind, and code Playground

by j08691

HTML

<input type="text" name="AREA" value="" id="v" />
<input type="button" value="click" onclick="getVal();" />

JavaScript

function getVal() {
    var age = document.getElementById('v').value;
    res = (age >= 18) ? "Adult" : "Minor";
    alert(res);
}