HTML form button
From w3cyberlearnings
Contents |
HTML - Button Tag
A button tag uses to create a button for a form. Within the button tag, you can put image or text, and that's why the button tag is not the same as <input> element.
HTML - Syntax Button Tag
<button type="button">Click Me</button>
Button Tag - Attributes
Attributes | Value | Example | Description |
---|---|---|---|
disabled | disabled | <button type="button" disabled="disabled">This Button is disabled</button> | Disable a button so user can not click |
type | button,reset, submit | <button type="button">Button</button> <button type="reset">Reset</button> <button type="submit">Submit</button> |
Specifies type of button to be created |
name | text | <button name="show_me" type="button">Show me your secret</button> | name the button tag |
value | text | <button name="show_me" type="button" value="show me now">Show me your secret</button> | Specifies the button value for server process |
Example 1 TRY-IT
<html> <head> <title>Button</title> </head> <body> <form> <button type="button" value="me">Click 4Me</button><br/> <button type="button" disabled="disabled" value="cancel">Click 4Cancel</button><br/> <button type="submit" value="submit_me">Submit Me</button><br/> <button type="reset" value="reset_me">Reset Me</button> </form> </body> </html>
Output
Related Link
- Form Radio
- Form Checkbox
- Form Button
- Form Submit
- Form Reset