HTML Input Type

In HTML different input type are used.

Text input type
<input type=”text” name=”name”>

Used to define text box

Example

<form action="page.html" method="POST/GET">
Name:
<input type="text" name="name"><br>
</form>

Password input type
<input type=”password”>
Used to define password text field:

Example

<form action="" method="POST/GET">
Password:
<input type="password" name="password">
</form>

Submit input type
<input type=”submit” name=”name”>

Used to define submit form button:

Example

<form action="" method="POST/GET">
Name:
<input type="text" name="name">
<input type="submit" value="Submit">
</form>

Checkbox input type
<input type=”checkbox”>

Used to defines a checkbox.

Example

<form>
<input type="checkbox" name="color" value="Red"> RED<br>
<input type="checkbox" name="color" value="Yellow"> Yellow
</form>

Radio input type
<input type=”radio” name=”name”>

Used to defines a radio button.

Example

<form action="" method="POST/GET">
<input type="radio" name="category" value="GEN" checked> General
<input type="radio" name="category" value="SC"> SC
</form>

Leave a Reply

Your email address will not be published. Required fields are marked *