开发者

jquery to check for empty field

开发者 https://www.devze.com 2023-02-03 07:17 出处:网络
开发者_开发问答How can i use jquery to check for the empty input field / to check if the field contains a specified string?

开发者_开发问答How can i use jquery to check for the empty input field / to check if the field contains a specified string?

I understand that valid8(); does something similar. Any working example?


.val() will give you an input element's value.

if ($("#element").val() == "") alert ("Empty!");

alternatively, use the jQuery form validation plugin which offers a broader range of possibilities (like enforcing a minimum length).

0

精彩评论

暂无评论...
验证码 换一张
取 消