
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML
The type attribute of the <button> element is used to set type of the button. Following is the syntax −
<button type="button|submit|reset">
Above, we have shown the different types set for the button element i.e.: submit −
- button: A clickable button
- submit: Submit button (submits form-data)
- reset: It is a reset button to reset it to the initial value.
Let us now see an example to implement the type attribute of the button element in HTML −
Example
<!DOCTYPE html> <html> <body> <h2>Investor Information</h2> <p>Give the information about the investor interested in funding:</p> <form action="" method="get"> ID: <input type="number"><br> Investor: <input type="text"><br> Funds: <input type="number"><br> Email: <input type="email"><br> DOB: <input type="date"><br><br> <button type="submit" value="Submit">Submit</button> <button type="reset" value="Reset">Reset</button> </form> </body> </html>
This will produce the following output with submit and reset button −
In the above example, we have created a form with form elements and buttons −
<form action="" method="get"> ID: <input type="number"><br> Investor: <input type="text"><br> Funds: <input type="number"><br> Email: <input type="email"><br> DOB: <input type="date"><br><br> <button type="submit" value="Submit">Submit</button> <button type="reset" value="Reset">Reset</button> </form>
The buttons type we have set to create a submit as well another button, which would be for reset −
<button type="submit" value="Submit"> Submit </button> <button type="reset" value="Reset"> Reset </button>
- Related Articles
- HTML type Attribute
- HTML maxlength Attribute
- HTML wrap Attribute
- HTML checked Attribute
- HTML datetime Attribute
- HTML value Attribute
- HTML coords Attribute
- HTML hreflang Attribute
- HTML cite Attribute
- HTML cite Attribute
- HTML autocomplete Attribute
- HTML max Attribute
- HTML placeholder Attribute
- HTML required Attribute
- HTML target Attribute

Advertisements