JSFiddle - React, Tailwind, and code Playground

by lanreng chengxu

HTML

<input name="aa" id="aa" type="text"/>
<button id="a">提交</button>

CSS

input { display: block; }

JavaScript

$("#a").click( function() {
    if($("#aa").val()==''){
        alert('用户名不能为空');
        $("#aa").focus();
    }
    return false;
});