1 回答

TA貢獻(xiàn)1886條經(jīng)驗(yàn) 獲得超2個(gè)贊
嘗試這個(gè):
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{}
}
添加回答
舉報(bào)