BUTTON in HTML

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

Comments
Load more comments.
Please Login or Sign up to comment.
logo
facebook youtube