1 回答

TA贡献1886条经验 获得超2个赞
尝试这个:
function checkLength(minLegth){
if (inputHandler.blur) {
if (inputHandler.value.length < minLegth){
message.textContent = "tiene que tener al menos " + minLegth + " caracteres";
inputHandler.style.borderColor = "red";
}
else{
message.textContent = "";
inputHandler.style.borderColor = "green";
}
}
if (inputListener.blur) {
if (inputListener.value.length < minLegth){
message.textContent = "tiene que tener al menos " + minLegth + " caracteres";
inputListener.style.borderColor = "red";
}
else{
message.textContent = "";
inputListener.style.borderColor = "green";
}
}
else{}
}
添加回答
举报