不支持

三连击

<html>
</head>
<script>
    function clickTime() {
        var text_ = document.form.text_;
        text_.value++;
        var T = setInterval(() => {
            text_.value = "0";
            clearInterval(T)
        }, 1000);
        if (text_.value == "3") {
            alert("点击了三次");
            text_.value = "0";
        }
    }
</script>
</head>

<body onclick="clickTime()">
    <form name="form" style="margin:20px auto;width:15px;height: 15px;">
        <input type="button" name="text_" value=0 disabled style="margin:20px auto;width:28px;height: 20px;">
    </form>
</body>

</html>

 

posted @ 2019-12-02 16:17  骑上我的小摩托  阅读(76)  评论(0编辑  收藏  举报