首页 > Web开发 > 详细

js模拟支付宝输入密码

时间:2017-04-11 17:18:50      阅读:269      评论:0      收藏:0      [点我收藏+]
<!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="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模拟支付宝输入密码

原文:http://www.cnblogs.com/zhuyupingit/p/6693807.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!