The JS control button is available in 10 seconds,

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.