HTML <input> <button> <submit>

Source: Internet
Author: User
Tags html form

Definition and usage

The Value property specifies the initial value associated with the button. Always specify the Type property for the button, or "Submit" if the default value is not filled in. The submit is actually a special button.

<button name= "Subject" type= "Submit" value= "HTML" >CSS</button>

Important : If you use the button element in an HTML form, the browser submits the content HTML of the Value property.

The text between <button> and <button/> is displayed on the button buttons on the CSS.


You typically use the INPUT element in an HTML form to create a button:
<input type= "button" Name= "BTN" value= "Commit"/>

the difference between button and submit in input

Type=button is simply a button function
Type=submit is the Send form

But for the Web UI people should be aware that using submit to improve the usability of the page:

    • After using submit, the page supports keyboard enter operations, while many web software designers may not notice the submit unification.
    • The page does not support the ENTER key after the button is used. Therefore, you need to support the ENTER key, you must set a submit, the default enter key to the first submit to the page operation.

<input type= "Submit" Name= "B1" value= "Submit" onclick= "Bt_submit_onclick ()" >
After executing the onclick, go to action. You can automatically submit no onclick required. So, the onclick here can not be.

<input type= "button" Name= "B1" value= "Submit" onclick= "Bt_submit_onclick ()" >
After executing the onclick, the jump file is controlled in the JS file. Submit requires onclick.

HTML <input> <button> <submit>

Related Article

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.