Home  »  HTML   »   button

An element used for interaction. The button is a container element.


name of the control. This becomes request name when form is submitted

  • Text without spaces

defines type of the button.

  • submit: Submits the form. This is a default feature of the button
  • reset: Resets the controls within the form to its default values
  • button: Does nothing. This is mainly used to add javascript interaction

Used when form is submitted the submitted data will have a button value in the data

  • Text

Disables the form control.

  • None

Sets focus to the control. This can be used only once per form

  • None

It associates the control to a form element. If absent, the control will be associated to its form ancestor.

  • Value of a form element's id attribute.

This will override a form element's action attribute. It defines the address where submitted data should be sent.

  • URL

Will override a form element's method attribute. Is changes the HTTP method by which submitted form data should be sent.

  • get: This method is used for simple data sending, such as search queries. The data is visible in the URL
  • post: This method sends data with an Invisible HTTP request. This method is more secure and the date sending limit can be extended by server configuration.

Defines the MIME type used to encode the form data

  • application/x-www-form-urlencoded: Default encoding not encryption.
  • text/plain: Basic text encoding.

Indicates that the form should not be validated before it is submitted

  • None

HTML Button Example:

Edit Example