HTML <input> type Attribute (original) (raw)

Last Updated : 25 May, 2026

The HTML type attribute defines the type of input field displayed in a form. It controls how users enter data and how the browser processes the input.

**Syntax:

Attribute Values

**Example: We have HTML form for username and password input with submit and reset buttons. Input type attributes: "text" for username, "password" for password.

html `

HTML input type Attribute

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

`