<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$永远的24k纯帅$</title>
</head>
<body>
<input type="text" value="" id="txt"/>
<script src="common.js"></script>
<script>
//获取文本框
my$("txt").onblur=function () {
//判断密码的长度
if(this.value.length>=6&&this.value.length<=10){
this.style.backgroundColor="red";
}else{
this.style.backgroundColor="green";
}
};
</script>
</body>
</html>