function checkUsername() {
//提取username输入的值
var username = document.getElementById("username");
//设定正则表达式
var reg_username = /^\w{6,12}$/;
//使用正则表达式判断username
var flag = reg_username.test(username);
var s_username = document.getElementById("s_username");
if (flag){
s_username.innerHTML = "<img src='img/gou.png' width='35' height='25'>";
}else {
s_username.innerHTML = "用户名错误,请重新输入";
}
return flag;
}