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

藏色散人
Release: 2020-11-17 10:46:03
Original
3507 people have browsed it

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();
}
});
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template