HTML button tag

By | March 13, 2020

In this chapter we will learn about <button> tag of HTML. If we want to create a button in a web page, we take the button tag. Button tag has a starting tag and an end tag.


If we need to create a form inside our web page, then we need a button in the form to submit it. For which we take the button tag, we can insert any text or image inside the button. After taking the button tag, we should always put the attribute in the button like this.

<button type="button">.....</button>

We can use the HTML button tag inside and outside the form. The button tag inside the form tag acts as a submit button tag, outside of the form, a JavaScript function call is placed above the button tag.

Browser Support:-

All modern browsers support the button tag of HTML.


Value Attribute Description
text valueSpecifies an initial value for the button

type Specifies the type of button
name name Specifies a name for the button

formtarget Specifies where to display the response after submitting the form. Only for type=”submit”
formnovalidate formnovalidate
Specifies that the form-data should not be validated on submission. Only for type=”submit”
formmethod Specifies how to send the form-data (which HTTP method to use). Only for type=”submit”
formenctype Specifies how form-data should be encoded before sending it to a server. Only for type=”submit”
URL formaction Specifies where to send the form-data when a form is submitted. Only for type=”submit”
form_id form Specifies which form the button belongs to
disabled disabled Specifies that a button should be disabled
autofocus autofocus Specifies that a button should automatically get focus when the page loads


<button type="button">Click button</button>


    	<input type="text" placeholder="Enter Name">
    	<input type="email" placeholder="Enter Email">
    	<button type="submit">Submit</button>


for job
learn coding
for result in india

Leave a Reply

Your email address will not be published. Required fields are marked *