首页 > 技术文章 > 密码长度为6-10的判断

hellocc 2019-07-25 11:29 原文

<input type="text" value="" id="mm"/>
 
 
document.getElementById("mm").onblur=function(){
if(mm.value.length>=6&&mm.value.length<=10){
this.style.backgroundColor="green";
}
else{
this.style.backgroundColor="red";
}
};

推荐阅读