The JS control button is available in 10 seconds,
This article describes how to use the JS control button 10 seconds later. We will share this with you for your reference. The details are as follows:
<Script language = "javascript"> function start () {document. getElementById ("Button1 "). disabled = true; document. getElementById ("Button1 "). value = 10; window. setTimeout ("tick ()", 1000);} function tick () {var time = new Number (document. getElementById ("Button1 "). value); if (time> 0) {document. getElementById ("Button1 "). value = time-1; window. setTimeout ("tick ()", 1000);} else {document. getElementById ("Button1 "). disabled = false; document. getElementById ("Button1 "). value = "save ";}} </script> <form> <input type = "button" NAME = "Button1" id = "Button1"> </form> <script language = javascript> start (); </script>
I hope this article will help you design JavaScript programs.
Articles you may be interested in:
- JS automatic countdown 30 seconds before the button is available (two scenarios)
- JS implementation click the check box to change the button or text box to gray unavailable Method
- The method that the submit button is unavailable after the javascript form is submitted
- JavaScript control buttons available or unavailable
- How to invalidate a button as unavailable by js and jquery