Version-//W3C//DTD XHTML 1.0 Strict//EN
Elementselect
Purposeoption selector
DescriptionThe select element is used to create a list of items from which the user can select. The select element is used in a form element and the options are defined by the option element.
Start tagRequired <select>
Attributes
NameTypeDefaultComment
class CDATA #IMPLIEDspace-separated list of classes
dir( ltr | rtl )#IMPLIEDdirection for weak/neutral text
disabled( disabled )#IMPLIEDunavailable in this context
idID#IMPLIEDdocument-wide unique id
langNMTOKEN#IMPLIEDlanguage code (backwards compatible); language code as RFC3066
multiple( multiple )#IMPLIEDdefault is single selection
name CDATA #IMPLIEDfield name
onblur CDATA #IMPLIEDscript expression; the element lost the focus
onchange CDATA #IMPLIEDscript expression; the element value was changed
onclick CDATA #IMPLIEDa pointer button was clicked; script expression
ondblclick CDATA #IMPLIEDa pointer button was double clicked; script expression
onfocus CDATA #IMPLIEDscript expression; the element got the focus
onkeydown CDATA #IMPLIEDa key was pressed down; script expression
onkeypress CDATA #IMPLIEDa key was pressed and released; script expression
onkeyup CDATA #IMPLIEDa key was released; script expression
onmousedown CDATA #IMPLIEDa pointer button was pressed down; script expression
onmousemove CDATA #IMPLIEDa pointer was moved within; script expression
onmouseout CDATA #IMPLIEDa pointer was moved away; script expression
onmouseover CDATA #IMPLIEDa pointer was moved onto; script expression
onmouseup CDATA #IMPLIEDa pointer button was released; script expression
size CDATA #IMPLIEDone or more digits; rows visible
style CDATA #IMPLIEDassociated style info; style sheet data
tabindex CDATA #IMPLIEDone or more digits; position in tabbing order
title CDATA #IMPLIEDadvisory title; text used for titles
xml:langNMTOKEN#IMPLIEDlanguage code (as per XML 1.0 spec); language code as RFC3066
Content( optgroup | option )+
End tagRequired </select>
Referenced in a abbr acronym address b bdo big caption cite code dd del dfn div dt em fieldset h1 h2 h3 h4 h5 h6 i ins kbd label legend li object p pre q samp small span strong sub sup td th tt var
Example
SourceAppearance
<form method="post" action="http://www.december.com/cgi-bin/formmail.secure.cgi"><input type="hidden" name="recipient"
value="nobody@december.com" />
<p>Your Name: <input type="text" size="15" name="user-name" /></p>
<p>Customer Number: <input type="number" size="10" name="customer-number" /></p>
<p>Shirt Size? <input type="radio" name="shirt-size" value="S" />S <input type="radio" name="shirt-size" value="M" />M
<input type="radio" name="shirt-size" value="L" />L <input type="radio" name="shirt-size" value="XL" />XL</p>
<p>What would you like?</p>
<p><select name="would-like" size="2" multiple="multiple">
<option>Order the product</option>
<option>Ask a question</option>
<option>Request a catalog</option></select></p>
<p>Your comments?<br />

<textarea name="comments" rows="4" cols="20">
</textarea></p>
<p><input type="submit" value="Send" /> <input type="reset" value="Cancel" /></p></form>

Your Name:

Customer Number:

Shirt Size? S M L XL

What would you like?

Your comments?

search Search · star Market
2023-06-19 · John December · Terms © johndecember.com