JavaScript 协议按钮禁用

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<textarea name="" id="" cols="30" rows="10">
    我就是协议,请仔细阅读
</textarea><br/>
<input type="button" value="请仔细阅读协议(5)" id="bt" disabled="disabled"/>
<script src="common.js"></script>
<script>
    var time = 5;
    var timeId = setInterval(function () {
        time--;
        my$("bt").value = "请仔细阅读协议(" + time + ")";
        if (time <= 0) {
            clearInterval(timeId);
            my$("bt").value = "注册";
            my$("bt").disabled = false;
        }
    }, 1000);
</script>
</body>
</html>

 

posted @ 2018-08-01 16:52  {颜逸}  阅读(429)  评论(0编辑  收藏  举报