HTML
<form action="/s.php" method="post">
设置密码:<input type="password" id="p1" required>
确认密码:<input type="password" id="p2" required onblur="checkpassword()">
<input type="submit" value="提交">
</form>
JS
<script>
function checkpassword() {
var password = document.getElementById("p1").value;
var repassword = document.getElementById("p2").value;
if(password!=repassword){
alert("设置密码与确认密码不匹配!")
document.getElementById('p1').value = "";
document.getElementById('p2').value = "";
}
}
</script>
友情提示:本站所有文章,如无特殊说明或标注,均为何星星原创发布。与此同时,趋于近年来本站的文章内容频繁被他站盗用与机器采集,现已全局禁用网站文字内容操作,了解详情或转载文章请 点此 继续!
0 条评论