欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js模擬支付寶密碼輸入框

 更新時(shí)間:2017年04月11日 16:16:26   作者:紫竹玉龍  
這篇文章主要為大家詳細(xì)介紹了js模擬支付寶密碼輸入框效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了js模擬支付寶密碼輸入框效果的具體代碼,供大家參考,具體內(nèi)容如下

效果圖:

代碼:

<!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;//服務(wù)器驗(yàn)證碼
  $('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('輸入錯(cuò)誤')
     }
  }
  )
 })
</script>
</html>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論