How many seconds does it take to register a JS control button before it can be determined whether the JS control button is available or unavailable?

Source: Internet
Author: User

Source: http://hi.baidu.com/yuanxiangyi/blog/item/961b3bd16411cb389a502758.html

How many seconds does it take to register the JavaScript code before you can click the specified JS control button to make it available and unavailable! <HTML>
<Head>
<Title> </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>

</Head>
<Body>
<Form name = "bbrules">
<Input type = "Submit" name = "rulesubmit" style = "height: 23px;" value = "agree"/>
</Form>

<Script language = "JavaScript">
<! --
// This JS segment must be placed under the form
VaR secs = 2;
VaR wait = secs * 1000;
Document. bbrules. rulesubmit. value = "Italian (" + secs + ")";
Document. bbrules. rulesubmit. Disabled = true;
For (I = 1; I <= secs; I ++)
{
Window. setTimeout ("Update (" + I + ")", I * 1000 );
}
Window. setTimeout ("timer ()", wait );

Function Update (Num, value)
{
If (num = (wait/1000 ))
{
Document. bbrules. rulesubmit. value = "agree ";
}
Else
{
Printnr = (wait/1000)-num;
Document. bbrules. rulesubmit. value = "Italian (" + printnr + ")";
}
}
Function timer ()
{
Document. bbrules. rulesubmit. Disabled = false;
Document. bbrules. rulesubmit. value = "agree ";
}
-->
</SCRIPT>

</Body>
</Html>
 

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.