Example
Two button elements that act as one submit button and one reset button (in a form):<form action="http://xhtml.co.il/tryit/html/html_form_submit_736.php" method="get"> First name: <input type="text" name="fname" /><br /> Last name: <input type="text" name="lname" /><br /> <button type="submit" value="Submit">Submit</button> <button type="reset" value="Reset">Reset</button> </form>
Definition and Usage
The type attribute specifies the type of a button.
Tip: Always specify the type attribute for the button. The default type for Internet Explorer is "button", while in other browsers (and in the W3C specification) it is "submit".
Browser Support
The
type attribute supported in all major browsersSyntax
<button type="value">
Attribute Values
| Value | Description |
|---|---|
| submit | The button is a submit button (this is default for all browsers, except Internet Explorer) |
| button | The button is a clickable button (this is default for Internet Explorer) |
| reset | The button is a reset button (clears form data) |
Was this information helpful?

