小编G_ *_*ter的帖子

如何使用Javascript制作一个5秒后才会出现的按钮?

标题几乎说明了一切:我需要帮助制作一个仅在页面加载后 5 秒出现的按钮。

这是我正在使用的代码:

                <html>
                <body onload="setTimeout(showStuff, 5000)">

                        <br><br><br><br><br><br><br><br><br><br><br><br><br>        
                        <div class=login align=center>
                        <font size=13 face=helvetica> You're doing that too much. </font><br> <br> <br>
                        <font size=5 face=helvetica>
                        You have entered the wrong username/password too many times <br>
                        <br><br>
                        <br><br>
                        Click "OK" to go back to the log-in page <br> <br>
                        <p id="Button"><input type=submit onclick="myFunction()" id="Button" value="OK"> </p>

                        <script>
                        document.getElementById("Button").style.visibility = "hidden";

                        function showStuff(Button){
                        document.getElementById("Button").style.display = "inline";}

                        function myFunction() {
                            window.location = "project.html"}


                        </script>
            </div> </font>
                </body>
            </html>
Run Code Online (Sandbox Code Playgroud)

html javascript

1
推荐指数
1
解决办法
5020
查看次数

标签 统计

html ×1

javascript ×1