Open In App

How to specify the type of an input element using HTML ?

In this article, we will specify the type of an input element using HTML. The HTML <input> type attribute is used to specify the type of <input> element to display. The default type of <input> type attribute is text.

Syntax:



<input type="value">

Attribute Values:

Example:






<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to specify the type of
        an input element using HTML?
    </title>
</head>
  
<body style="text-align:center;">
  
    <h1 style="color:green;">GeeksforGeeks</h1>
  
    <h3>
        How to specify the type of an
        input element using HTML?
    </h3>
  
    <form action="#" method="get">
        Username: <input type="text" name="uname">
  
        <br><br>
  
        Password: <input type="password" name="pwd">
  
        <br><br>
  
        <button type="submit" value="submit">
            Submit
        </button>
  
        <button type="reset" value="reset">
            Reset
        </button>
    </form>
</body>
  
</html>

Output:


Article Tags :