<button type="">
Browser |
|
---|---|
Type |
The BUTTON element defines a submit button, reset button, or push button.
<button type="button">button content</button>
<button type="submit" name="name" value="example">button content</button>
Attribute | Value | Explanation |
---|---|---|
type=" " | submit | creates a submit button |
reset | creates a reset button | |
button | creates a push button | |
name=" " | button name | a unique name for the button |
value=" " | initial value | this value is submitted |
The content of the BUTTON element is displayed on the button.
For example,
<button type="button">Button Content</button>
<button type="button"><b>Button Content</b></button>
<button type="button"><img src="piyo.gif" alt="PiyoPiyo" width="50" height="50"></button>
- type="submit"
- Creates a submit button on the form. When this button is clicked, the form data is submitted to the server.
- type="reset"
- Creates a reset button on the form. When this button is clicked, the input is reset.
- type="button"
- Creates a general purpose button.
- name=""
- The button name is used to identify the clicked button.
- value=""
- This value is submitted to the server when the button is clicked.