HyperText Markup Language/Tag List/select

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Contents

[edit] Use

This builds a List Box. Used for selecting a value from a list. This is to be used in relation with the option tag.

[edit] Example

<select name="animals">
<option selected value="Bird">Bird</option>
<option value="Reptile">Reptile</option>
<option value="Mammal">Mammal</option>
</select>

[edit] Required attributes

[edit] name

Name of the value in the form.

[edit] Optional attributes

[edit] class

Assocciated CSS classes.

[edit] dir

The direction of the text. You can choose from "ltr" (left to right) or "rtl" (right to left).

[edit] disabled

Locks in the control so theuser cannot modify the valu in the list box.

[edit] id

A string that is in the webpage.

[edit] lang

The ISO language code that you want to use for the tag.

[edit] multiple

Allows the value tag to allow multiple selections.

[edit] size

The size of the list box. It is measured in either rows or as a percentage on the screen.

[edit] style

CSS commands.

[edit] tabindex

The order of the controls recieved by the form.

[edit] title

The title of the tag.

[edit] Standard attributes

[edit] name

[edit] More info

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

In other languages