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>