<h3>后台管理员登录</h3>
<form>
管理员名称:<input type="text" value="" id="aname" /><br />
管理员密码:<input type="password" value="" id="apwd" /><br />
<span id="tip" style="color: red;"></span><br />
<input type="button" id="btn" value="登录" />
</form> <!--
成功跳转main.html网页
location.href="main.html" -->
<script>
//1.获取登录按钮,id=btn 并且绑定点击事件 onclick
btn.οnclick=function(){
//1.1创建正则表达式验证用户名密码,字母数字3~11
var reg=/^[a-zA-Z0-9]{3,11}$/
//1.2判断如果管理员与正则表达式不同
HTML 管理员登陆小功能 连接数据库
最新推荐文章于 2023-03-31 12:11:54 发布