Html 5 Button tag

In the html5 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. HTML5 has new attributes are autofocus,form, formaction, formenctype, formmethod, formnovalidate, and formtarget.


<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.