How to set the minlength property of a input element using jQuery. Its required like that because it will vary.. Is there a jQuer开发者_如何转开发y api to do that?
jQuery validate plugins can do that for you
http://docs.jquery.com/Plugins/Validation/Methods/minlength
$("#myform").validate({
rules: {
field: {
required: true,
minlength: 3
}
}
})
精彩评论