HyperText Markup Language/Tag List/input

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Use[edit | edit source]

These input data from the user. They can be inputs such as text boxes or selection boxes.

Example[edit | edit source]

<input type="text" name="textinput" size="30"/>

Required attributes[edit | edit source]

type[edit | edit source]

Type tells the browser what type of input element this is. It can be one of the following:

  • "text": A one line text box.
  • "radio": Small circular choice buttons.
  • "checkbox": A small square choice button.
  • "password": A password box. For security, it shows all characters as "*".
  • "hidden": Hidden text in a web page.
  • "file": Presents a text box for entering the full name of a local file. Also has a "browse" button to select the file.
  • "submit": Submit button.
  • "image": Image Button.
  • "reset": A reset button.

Optional attributes[edit | edit source]

name[edit | edit source]

Names the attribute. When the form is sent off, the user would want to know what the information is.

size[edit | edit source]

The size of the text box. This is done in a percentage.

value[edit | edit source]

Use this when the type attribute has been set to radio. Tells the form what the value is when the box has been highlighted.

checked[edit | edit source]

Use this to define a value in the checkbox. Use with checkbox only.

Standard attributes[edit | edit source]

More info[edit | edit source]

A link to a page with more info, then the name of the site the info came from (i.e. W3Schools).