开发者

jquery to check for empty field

开发者_开发问答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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜