首页 > 代码库 > js模拟支付宝输入密码
js模拟支付宝输入密码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
input{
width:60px;
height:60px;
font-size:40px;
line-height: 60px;
}
</style>
<body>
<input type="password"/>
<input type="password"/>
<input type="password"/>
<input type="password"/>
</body>
<script src="http://www.mamicode.com/jquery-1.11.3.js"></script>
<script>
$(function(){
var ww=2222;//服务器验证码
$(‘input‘).eq(0).focus();
$(‘input‘).keyup(function(){
if($(this).val().length==1){
$(this).next().focus()
}
})
$(‘input‘).eq($(‘input‘).length-1).keyup(function(){
var valed=‘‘
for(var i=0;i<$(‘input‘).length;i++){
valed=valed+$(‘input‘).eq(i).val()
}
if(Number(valed)==ww){
alert(‘输入正确‘)
}else{
alert(‘输入错误‘)
}
}
)
})
</script>
</html>
js模拟支付宝输入密码
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。