BUTTON in HTML

13
Mr. Coder | 06-Oct-2024
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.

  1. button : Used for firing the JavaScript functions
  2. submit : used to submit the form
  3. reset : Used to reset all the fields of the form

Output
<input type="button" value="Submit" />


<button type="button">Submit</button>

logo
facebook youtube