JSFiddle - React, Tailwind, and code Playground

HTML

<form>
    <input />
    <input />
    <input />
    <button type="submit">Submit</button>
</form>

JavaScript

$("form").on("submit", function() {
    var anyFieldIsEmpty = $("form input").filter(function() {
            return $.trim(this.value).length === 0;
        }).length > 0;

    if (anyFieldIsEmpty) {
        alert("There are empty fields!");
    }

    return false;
});