HTML input type button Tutorial

In this section, we will learn what the <input type = “button”> element is and how to use it.

What is input type button in HTML?

The <input> element of type `button` is used to create a button in a document.

This button then could be used for different purposes, including as a submit button, reset button and other matters on a webpage.

We mainly use a third party language, like JavaScript, to modify and set the instructions for the target button element.

Basically, an input element of type button by default doesn’t do anything unless we program it to do otherwise (With the help of programming languages like JavaScript).

Note: use the `value` attribute in the target <input> element to set the text content of that button.

HTML input type button Syntax:

<input type = “button” value = “Click me”>

Example: using <input type=”button”> in HTML

See the Pen using <input type="button"> in HTML by Omid Dehghan (@odehghan) on CodePen.


Top Technologies