HTML button type property
Examples
Two button element is a submit button, reset button and the other is:
<form action="demo_form.html" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit" value="提交">提交</button>
<button type="reset" value="重置">重置</button>
</form>
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit" value="提交">提交</button>
<button type="reset" value="重置">重置</button>
</form>
try it"
Browser Support
All major browsers support the type attribute.
Definition and Usage
type attribute specifies the type of buttons.
Tip: Always provisions for the button type attribute. Internet Explorer is the default type "button", while other browsers default values (including the W3C specification) is "submit".
Differences between HTML 4.01 and HTML5
NONE.
grammar
<button type="button|submit|reset">
Property Value
value | description |
---|---|
submit | This button is a submit button (in addition to Internet Explorer, which is the default value other browsers). |
button | This button is clickable button (default value for Internet Explorer). |
reset | This button is the reset button (to clear form data). |
HTML <button> tag