Introduction
Button is displayed either by using <input> tag or <button> tag. We prefer using <button> tag.
<input> tag requires the type attribute to set as button as shown in the below code example
<input type="button" value="Submit" />
<button> tag is a paired tag and it has 3 types defined in it button, submit and reset.
- button : Used for firing the JavaScript functions
- submit : used to submit the form
- reset : Used to reset all the fields of the form
Output
<input type="button" value="Submit" />
<button type="button">Submit</button>