用户名密码登录
<style>
.box4{width: 400px;
height: 400px;
margin-top:150px ;
margin-left:500px;
/* margin-right:150px; */
border-color: black;}
</style>
<script>
function myFunction()
{ alert("保存成功!请登录");}
</script>
</head>
<body>
<div class="box4" type = "center" >
<style type = text/css>
body{background-image:url(img/bg.png);}
</style>
<form method="get" action="###" name="myform" onsubmit="checkpost()">
<label for="name">用户名: </label><input type = "text" name = "name" id="name"/><br>
<br>
<br>
<label for="pw">密 码: </label><input type = "password" name = "pw" id="pw"/><br>
<br>
<input type = "submit" value = "登录"/>
<button onclick="myFunction()">保存</button>
</div>
</form>
<script>
function checkpost(){
if(document.forms[0].name.value=="用户名"&&document.forms[0].pw.value=="密码"){
action="跳转地址";
}else{alert("用户名或密码不正确!")
return false;}}
</script>
</div>