html Button tag

In the html button tag is used to create button control. Which tag also use to inside of form and you can put content or image inside of button tag. Mostly type attribute we will used for button. html has new attributes are autofocus,form, formaction, formenctype, formmethod, formnovalidate, and formtarget.

In the internet explorer browser default button type attribute is button and other browser default <input> type attributes are submit.

Syntax:

<button> ... </button>

Example Code

<button onclick = "JavaScript:alert('Thanks for Clicked Button!')"> Click </button>

Out Put:



In the above example <button> tag has been added to click content and when you click button, "Thanks for Clicked Button" message will appear on the above button.




Content