Home >Web Front-end >JS Tutorial >How to determine whether the input box is empty in jquery
Jquery method to determine whether the input box is empty: first create a front-end code sample file; then pass the statement "$(function () {var t = $("#airline");if (t.val () == "") {t.focus();}})" to realize the judgment.
Recommended: "javascript basic tutorial"
jquery determines whether all input boxes are empty
The code is as follows:
$(function () { var t = $("#airline"); if (t.val() == "") { t.focus(); } });
The above is the detailed content of How to determine whether the input box is empty in jquery. For more information, please follow other related articles on the PHP Chinese website!