level 3
这个是源代码<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
#bg{
background-color: aliceblue;
width: 320px;
left: 40%;
top: 40%;
border-radius: 5px;
position: absolute;
}
</style>
<script type="text/javascript">
function login(){
var username=document.getElementById("username").value;
var password=document.getElementById("password").value;
if(username==null||username==""){
alert("请输入用户名");
return;
}
if(password==null||password==""){
alert("请输入密码");
return;
}
if(username=="mr"&&password=="mrsoft"){
alert("登录成功");
window.open(js2.html);
}
else{
alert("用户名或密码错误,请重新输入");
window.location.reload();
}
}
</script>
</head>
<body>
<div id="bg">
<table style="width: 300px;" border="0" align="center">
<tr>
<td>用户名:</td>
<td>
<input type="text" placeholder="请输入用户名"/>
</td>
</tr>
<tr>
<td>密码:</td>
<td>
<input type="password" placeholder="请输入密码"/>
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="button" value="登录" onclick="login()"/>
<input type="button" value="注册" onclick=""/>
</td>
</tr>
</table>
</div>
</body>
</html>
2022年11月09日 12点11分


