我有这段代码,它显示了我的错误,我正在尝试设置以下三个验证的样式,请更正下面的错误..这可能吗?
if (name == '' || name.length <= 2) {
valid = '<p>Your name' + required +'</p>';
}
if (!email.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
valid += '<p>Your email' + required +'</p>';
}
if (mydropdown == '') {
valid += '<p>An item from the list' + required +'</p>';
}
// let the user know if there are erros with the form
if (valid != '') {
$('form #response').removeClass().addClass('error strong')
.html('<strong>Please correct the errors below.</strong>' +valid).fadeIn('fast');
}