HTML登录注册

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script scr="static/js/jquery.js"></script>
<script>
$(document).ready(function (){
$("#msg").click(function (){
var username = $("#username").val()
if (username == ""){
alert("用户名不能为空")
return false
}
var password = $("#password").val()
if (password == ""){
alert("密码不能为空")
return false
}
})
})
</script>

</head>
<body>
<form action="" method="post">
<table border="1px" align="center">
<h1 align="center">登录</h1>
<tr>
<td>请输入邮箱:</td>
<td><input type="text" name="eamil" id="username"></td>
</tr>
<tr>
<td>请输入密码:</td>
<td><input type="text" name="password" id="password"></td>
</tr>
<tr>
<td><button id="msg">登录</button></td>
<td><button><a href="{% url 'zhuce' %}">注册</a></button></td>
</tr>
</table>
</form>
</body>
</html>
posted @ 2021-03-15 14:49  沈海  阅读(400)  评论(0)    收藏  举报