开发者_开发问答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).
精彩评论