JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="text">
<span id="click">click</span>

JavaScript

$("#click").click(function(){

    if($("#text").val().length < 1){
       alert("click is empty!");
       false;
    }
    
    alert("ok");
})