Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.0.0.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<span class="huoqu">获取验证码</span>
</body>
</html>
 
.huoqu {
    width: 95px;
    line-height: 42px;
    text-align: center;
    color: #fff;
    background: #2eafb3;
    display: inline-block;
    cursor: pointer;
    position: relative;
    left: -3px;
}
.gray{
  background:#ccc;
}
 
$(".huoqu").on("click",function(){
  $(this).addClass("gray");
  var wait=60;
  $(this).html(wait+"s后获取");
  function fstime(){
     wait--;
     console.log(wait);
    $(".gray").html(wait+"s后获取");
  }
  setInterval(fstime,1000);
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers