<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>欢迎登陆</title>
<link href="../static/css/zz.css" rel="stylesheet" type="text/css">
<script>
function myLogin() {
var oUname = document.getElementById("name");
var oError = document.getElementById("error_box");
var opassword = document.getElementById("password");
if(oUname.value.length<6){
oError.innerHTML="用户名至少6个字符"
}
}
</script>
</head>
<body>
<div class="box" >
<div class="jar" ><h2>欢迎登录</h2></div>
<div class="input_box" >
姓名:<input id="name" type="text" placeholder="请输入用户名"><br>
密码:<input id="password" type="password" placeholder="请输入密码"><br>
</div>
<div id="error_box"><br></div>
<div class="ja" >
<button onclick="myLogin()">登录</button>
<button type="button" onclick=window.alert("是否取消登录?")>取消</button>
</div>
</div>
</body>
</html>
div{
margin:0 auto;
text-align:center;
}
.box{
width:500px;
height:200px;
border-color:blue;
border-style:groove;
border-width:1px;
margin-top:100px;
}
.input_box{
font-size:18px;
font-weight:bold;
}
.ja{
width:100px;
height:30px;
}