Two button elements that act as one submit button and one reset button (in a form):
The type attribute specifies the type of button.
Tip: Always specify the type attribute for the <button> element. Different browsers may use different default types for the <button> element.

<button type="button|submit|reset">
| Value | Description |
|---|---|
| button | The button is a clickable button |
| submit | The button is a submit button (submits form-data) |
| reset | The button is a reset button (resets the form-data to its initial values) |
<form action="/action_page.php" method="get">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<button type="submit" value="Submit">Submit</button>
<button type="reset" value="Reset">Reset</button>
</form>
Type: | html |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded by: | Admin |