<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>欢迎加入</title>
<link type="text/css" rel="stylesheet" href="注册样式.css">
<link type="text/css" rel="stylesheet" href="轮播图片.css">
</head>
<body>
<script type="text/javascript" src="js/jquery-3.5.1/jquery-3.5.1.min.js"></script>
<div id="container" >
<!--图片播放-->
<div id="div0">
<div class="picture">
<div class="picture-1"><img src="轮播图/1.jpg" alt="图片丢失" height="936" width="1518"> </div>
<div class="picture-1"><img src="轮播图/2.jpg" alt="图片丢失" height="936" width="1518"> </div>
<div class="picture-1"><img src="轮播图/3.jpg" alt="图片丢失" height="936" width="1518"> </div>
</div>
<script type="text/ecmascript">
$(function(){
var index=0;
setInterval(function(){
if(index==$(".picture-1").length-1){
index=0;
$(".picture-1").css("opacity","0");
$(".picture-1").eq(index).css("opacity","1");
}
else{
index++;
$(".picture-1").css("opacity","0");
$(".picture-1").eq(index).css("opacity","1");
}
},2000)
})
</script>
</div>
<!--用户名密码检查-->
<script type="text/javascript">
var temp;
var tempp;
var temppp;
function checkpassword()
{
var pw1=document.getElementById("pwd1").value;
temp=pw1;
var pw2=document.getElementById("pwd2").value;
tempp=pw2;
var user=document.getElementById("user").value;
temppp=user;
}
function ps()
{
var pw1=temp;
var pw2=tempp;
var user=temppp;
if(!user)
{
alert("用户名不能为空");
}
else{
if(!pw1)
{
alert("请输入密码");
}
else{
if(!pw2){
alert("请确认密码");
}
else{
if(pw1!=pw2){
alert("密码不一致");
}
else{
alert("注册成功");
}
}
}
}
}
</script>
<div id="div1">
<form action="http://192.168.1.17/" method="post">
<div id="div2">
<font size="5" ><a href="登录.html">登录</a> <a href="注册.html">注册</a></font>
</div>
<div id="div22"></div>
<div id="div21" >
用户类别:<input type="radio" name="t" value="0" checked="checked">学生
<input type="radio" name="t" value="1">老师
<input type="radio" name="t" value="2">管理员
</div>
<div id="div3" >
<input style="width: 250px;height: 40px;border-radius: 10px;" type="text" placeholder="用户名" id="user" name="userr" >
</div>
<div id="div4">
<input style="width: 250px;height: 40px;border-radius: 10px;" type="password" placeholder="密码" id="pwd1" name="pwd11" >
</div>
<div id="div5">
<input style="width: 250px;height: 40px;border-radius: 10px;" type="password" placeholder="请确认密码" id="pwd2" name="pwd21" onkeyup="checkpassword()" >
</div>
<div id="div6">
<input type="submit" value="注册" style="width:250px;height:50px" class="yanse" onclick="ps()">
</div>
</form>
<!--对错小图标
<div id="div7"></div>
<div id="div8"></div>
-->
</div>
</div>
</body>
</html>
HTML的密码校对,之前还可以提示密码是否一样,现在提示不了
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答 默认 最新
- CSDN专家-天际的海浪 2022-02-14 20:45关注
alert("注册成功")之后的分号写成了中文全角的,要改成英文半角的。
你题目的解答代码如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>欢迎加入</title> <link type="text/css" rel="stylesheet" href="注册样式.css"> <link type="text/css" rel="stylesheet" href="轮播图片.css"> </head> <body> <script type="text/javascript" src="js/jquery-3.5.1/jquery-3.5.1.min.js"></script> <div id="container" > <!--图片播放--> <div id="div0"> <div class="picture"> <div class="picture-1"><img src="轮播图/1.jpg" alt="图片丢失" height="936" width="1518"> </div> <div class="picture-1"><img src="轮播图/2.jpg" alt="图片丢失" height="936" width="1518"> </div> <div class="picture-1"><img src="轮播图/3.jpg" alt="图片丢失" height="936" width="1518"> </div> </div> <script type="text/ecmascript"> $(function(){ var index=0; setInterval(function(){ if(index==$(".picture-1").length-1){ index=0; $(".picture-1").css("opacity","0"); $(".picture-1").eq(index).css("opacity","1"); } else{ index++; $(".picture-1").css("opacity","0"); $(".picture-1").eq(index).css("opacity","1"); } },2000) }) </script> </div> <!--用户名密码检查--> <script type="text/javascript"> function ps() { var pw1 = document.getElementById("pwd1").value; var pw2 = document.getElementById("pwd2").value; var user = document.getElementById("user").value; if (user == "") { alert("用户名不能为空"); } else { if (pw1 == "") { alert("请输入密码"); } else { if (pw2 == "") { alert("请确认密码"); } else { if (pw1 != pw2) { alert("密码不一致"); } else { alert("注册成功"); } } } } } </script> <div id="div1"> <form action="http://192.168.1.17/" method="post"> <div id="div2"> <font size="5" ><a href="登录.html">登录</a> <a href="注册.html">注册</a></font> </div> <div id="div22"></div> <div id="div21" > 用户类别:<input type="radio" name="t" value="0" checked="checked">学生 <input type="radio" name="t" value="1">老师 <input type="radio" name="t" value="2">管理员 </div> <div id="div3" > <input style="width: 250px;height: 40px;border-radius: 10px;" type="text" placeholder="用户名" id="user" name="userr" > </div> <div id="div4"> <input style="width: 250px;height: 40px;border-radius: 10px;" type="password" placeholder="密码" id="pwd1" name="pwd11" > </div> <div id="div5"> <input style="width: 250px;height: 40px;border-radius: 10px;" type="password" placeholder="请确认密码" id="pwd2" name="pwd21" > </div> <div id="div6"> <input type="submit" value="注册" style="width:250px;height:50px" class="yanse" onclick="ps()"> </div> </form> <!--对错小图标 <div id="div7"></div> <div id="div8"></div> --> </div> </div> </body> </html>
如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报 编辑记录
悬赏问题
- ¥170 如图所示配置eNSP
- ¥20 docker里部署springboot项目,访问不到扬声器
- ¥15 netty整合springboot之后自动重连失效
- ¥15 悬赏!微信开发者工具报错,求帮改
- ¥20 wireshark抓不到vlan
- ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
- ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
- ¥15 stata安慰剂检验作图但是真实值不出现在图上
- ¥15 c程序不知道为什么得不到结果
- ¥15 键盘指令混乱情况下的启动盘系统重装