Jazzo.co.uk uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our Privacy Policy and our Terms & Condition.

HTML <button>

query_builder | Christopher Pisani

The HTML element <button> represents a clickable button, which can be used in forms or anywhere in a document that needs simple, standard button functionality.

This element can work for submitting and resetting the form, but it is advisable to use the <input> element for that job. Advantage of buttons vs input elements is that they can hold clickable images as well. The button element is also widely used in conjunction with Javascript language, to run custom scripts.

Important Note :

It is inapproriate for other elements like <span>, <div> and <a> to be used instead of the element <button>.

Available Attributes

Attribute Values Functionality
autofocus boolean Will auto highlight the button when page loads
disabled boolean Disables the button, actions linked to the button will not work
form The form's id Specifies which form is part of
formaction url Where the data is sent on submission
formenctype application/x-www-form-urlencoded
What data is to be used
formmethod GET
How data is sent as
formnovalidate boolean If form will be validated or not
formtarget url where to display results after submitting
name text name associated with the button
type button
Button's behaviour
value text default value for button