防止按钮重复点击

 

demo

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <html>

    <head>
        <script type="text/javascript">
            function disable() {
                document.getElementById('b').disabled = true;
            }

            function enable() {
                document.getElementById('txt1').disabled = false;
            }
        </script>
    </head>

    <body>

        <textarea id="txt1">Hello world....This is a text area</textarea>
        <br />
        <input id="t" type="button" onclick="disable()" value="Disable" />
        <input id="b" type="button" onclick="enable()" value="Enable" />

    </body>

    </html>

 

posted @ 2020-10-13 16:14  雁书几封  阅读(141)  评论(0编辑  收藏  举报