Home >Web Front-end >JS Tutorial >How to determine whether the input box is empty in jquery

How to determine whether the input box is empty in jquery

藏色散人
藏色散人Original
2020-11-17 10:46:033517browse

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.

How to determine whether the input box is empty in jquery

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn