HTML: Input Tag

By Xah Lee. Date: . Last updated: .

2018-10-23 This page is under revision

The input tag is used to generate many different types of inputs such as buttons, menu, checkboxes, search box, message box, etc.

Example:

see


the following is work in progress

file

<input type="file" />

hidden

<input type="hidden" />

date

<input type="date" />

datetime-local

<input type="datetime-local" />

email

<input type="email" />

image

<input type="image" />

month

<input type="month" />

search

<input type="search" />

tel

<input type="tel" />

time

<input type="time" />

url

<input type="url" />

week

<input type="week" />

Submit Buttons

INPUT with attribute type="submit" draws submit buttons. When these buttons are pressed, the form is sent to the CGI program. The name and value attributes are optional.

Submit button 1:

<input type="submit" name="submit1">

Multiple Submit Buttons

You can have multiple submit buttons, with name and value attributes. The name attribute can be the same. The value of the value will be shown as the text on button, and is the value string sent to the server.

<input type="submit" name="license_agreement" value="agree">
<input type="submit" name="license_agreement" value="disagree">

Reset Button

The type="reset" shows a button with a special action that tells the browser to reset the form.

<input type="reset" name="reset" value="Reset">
BUY ΣJS JavaScript in Depth