Delayed effective button

Source: Internet
Author: User
Code

<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd" >
< Html >
< Head >
< Meta HTTP-equiv = "Content-Type" Content = "Text/html; charsets = UTF-8" >
< Title > Insert title here </ Title >
< Script Type = "Text/JavaScript" >
Function $ (ID ){
Return Document. getelementbyid (ID );
}

VaR Remain = 10 ;
Function Init (){
$ ( " BTN " ). Innerhtml =   " Submit ( " + (Remain -- ) + " Seconds) " ;
If (Remain > 0 ){
Window. setTimeout (init, 1000 );
}
Else {
$ ( " BTN " ). Disabled =   False ;
$ ( " BTN " ). Innerhtml =   " Submit " ;
}
}
</ Script >
</ Head >
< Body Onload = "Init ()" >
< Button ID = "BTN" Disabled = "Disabled"   > Submit </ Button >
</ Body >
</ Html >

 About button:

Definition and usage

<Button> the tag defines a button.

Inside the button element, you can place content, such as text or images. This is the difference between this element and the button created using the input element.

Compared with <input type = "button">, the <button> Control provides more powerful functions and richer content. All content between the <button> and </button> labels is the content of the button, including any acceptable body content, such as text or multimedia content. For example, you can include an image and related text in a button and use them to create an attractive labeled image in the button.

The only prohibited element is image ing because its mouse-and keyboard-sensitive actions interfere with form buttons.

Always define the type attribute for the button. The default type of Internet Explorer is "button", while that of other browsers (including W3C specifications) is "Submit ".

 

Important:If the button element is used in an HTML form, different browsers submit different values. Internet Explorer submits the text between <button> and <button/>, while other browsers submit the content of the value attribute.Please use in HTML formInput element to create a button.

 

 

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.