<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="jquery.js"></script>
</head>
<body>
用户名:<input id="username" placeholder="6-12位 首字母需大写"></br>
密码:<input id="password" type="password" placeholder="6-12位"></br>
<input type="submit" value="注册" onclick="tap()">
<script>
function tap(){
username=document.getElementById("username").value.split("")
password=document.getElementById("password").value.split("")
cap=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
if(username.length>5&&username.length<13&&password.length>5&&password.length<13){
for(i=0;i<cap.length;++i){
if(username[0]==cap[i]){
alert("注册成功,前往登录")
location="denglu.html?"+username+"#"+password
break
}else if(i==25){alert("注册失败")}
}
}else{alert("注册失败")}
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="jquery.js"></script>
</head>
<body>
用户名:<input id="username" placeholder="请输入用户名:"></br>
密码:<input id="password" type="password" placeholder="请输入密码:"></br>
<input type="button" value="登录" onclick="tap()">
<script>
function tap(){
if(location.search.split(",").join("")=="?"+document.getElementById("username").value&&location.hash.split(",").join("")=="#"+document.getElementById("password").value){
alert("登陆成功")
}else{alert("用户名或密码错误")}
}
</script>
</body>
</html>