Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

<select>

<select
class=type
disabled
dir=ltr|rtr
id=value
lang=language
multiple
name=name
size=n
style=style
tabindex=string
title=text
</select>

Denotes a list box or drop-down list. The end-tag encloses any <option> tags that may appear within the <select> tag.

For example:

<select name="cars" size="1">
    <option value="1">BMW
    <option value="2">Porsche
    <option value="3" selected>Mercedes
</select>

Attributes

class=type

Indicates the class to which the tag belongs. You can use the class attribute in a style sheet to create different styles that you want apply to a single HTML tag. For example, you might create three different styles for a heading <hn> tag. See Using the class attribute as a selector for more details.

dir=ltr|rtr

Specifies the direction of text. This can be left-to-right (ltr) or right-to-left (rtl). For example, English characters are presented left-to-right, Hebrew characters are presented right-to-left.

disabled

Prevents the drop-down list from accepting the users focus.

id=value

Specifies a unique name for the tag. No two tags can have the same id on a single page. The value must begin with a letter followed by any alphanumeric character, a hyphen, an underscore, a colon or a full stop. You use it to reference a unique style for a tag or to manipulate the tag with a script.

lang=language

Specifies which language the <select> tag uses. You can enter any valid ISO standard language abbreviation, for example, “en” for English, “de” for German and so on. For example, <span lang="es">hola! como esta?</span>.

This attribute helps search engines understand different languages as different languages rather than just misspelled English. It may also help spelling and grammar checkers and allow speech synthesizers to use language-dependent pronunciation rules.

multiple

Use the multiple attribute if users can make several selections at the same time.

name=name

Specifies a name for the list box or drop-down list.

size=n

Specifies the height of the list control.

style=style

Specifies style information. See Style sheets for more information.

tabindex=string

Sets a tabbing order for the user to navigate around the main form.

title=text

For information only. Some browsers display the title when you move the mouse over the tag (like a tool tip).