HTML Reference Guide


Tag Index| Content List| HTML FAQ

<SELECT> ... </SELECT> SELECTION LIST

Description:

The SELECT element indicates the contents will be a list of values. The values of this list are represented by one or more OPTION elements. A common implementation is a drop-down list box.

Attributes:

accesskey - This is a method of giving access/focus to an active HTML element using a keyboard character. This is a common GUI paradigm also known as a "keyboard shortcut" or "keyboard accelerator" A single character is used as the value of this attribute. In addition, a platform-dependent key is usually used in combination with the ACCESSKEY character to access the functionality of the active field.

align - This specifies the alignment of text following the selection list relative to the list on the rendering device. LEFT and RIGHT alignment specify floating horizontal alignment of the selection list in the browser window, and subsequent content in the document will wrap around the list. The other values specify vertical alignment of content relative to the selection list on the same line.

disabled - This is a stand-alone attribute which indicates the element is initially non-functional.

multiple - This attribute indicates that more than one option can be selected at one time to be included in the return value to the form processing script.

onblur - A blur Event Handler executes Script code when a Selection List field in a form loses focus.

onchange - A change Event Handler executes Script code when a Selection List field loses focus and its value has been modified. This Event Handler is used to validate data after it is modified by a user.

onfocus - A focus Event Handler executes Script code when a Selection List field receives input focus by tabbing with the keyboard or clicking with the mouse. Selecting within a field results in a onSelect event, not a onFocus event.

size - Specifies the number of visible items in the list.

tabindex - "Tabbing" is a method of giving access/focus to an active HTML element using a standard keyboard sequence. All the active elements in a document can be cycled through using this sequence (ex: Windows TAB key.) The order of the active elements in this cycle is usually the order they occur in the document, but the TABINDEX attribute allows a different order to be established. The use of this attribute should create the following tabbing order cycle if the browser supports the attribute:

1.Active elements using the TABINDEX attribute with positive integers are navigated first. Low values are navigated first.
2.Active elements not specifying any TABINDEX attribute.
Those elements carrying a DISABLED attribute or using negative TABINDEX values do not participate in the tabbing cycle.

Example code:

<p><form><select NAME="list1" SIZE=3 MULTIPLE><option VALUE="opt1">option1<option VALUE="opt2">option2<option SELECTED VALUE="opt3">option3</select></form><p>

Result:

See Also: