1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function myfunction(){
var x = document.getElementById("input1");
c = /^[a-zA-Z0-9]{6,8}$/;
if((x.value).match(c)){
alert("输入正确!");
w.style.display="none";
}
else if((x.value)==""){
alert("请输入!");
}
else{
alert("错误!");
x.value = "";
}
}