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

  1. Button
  2. Text Field
  3. Password Field
  4. Text Area
  5. Number Field
  6. Radio Button πŸ”˜
  7. Checkbox πŸ—Ή
  8. Popup Menu β–€
  9. Slider 🎚
  10. Color Picker 🌈

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

DOM How-To


Web Scripting Overview


HTML Input


Web Scripting Examples


Web Scripting Misc


jQuery


node.js

Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials