Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

select

The <select> element is used to render a drop down style selection list in form applications. The <option> elements are placed inside of it to render the choices for the user to select from.

Code Example

Choose Instrument: <select name="instrument" required> <option value="Guitar">Guitar</option> <option value="Harp">Harp</option> <option value="Piano">Piano</option> <option value="Trumpet" disabled="disabled">Trumpet</option> </select> open in code editor

Attributes

globals - the global attributes common to all elements possible values: see global attribute list autofocus - specify that the element is to have focus automatically possible values: value not required disabled - specify that the element be disabled possible values: value not required form - specify a form to associate this element to possible values: "form id" multiple - specify that the element can accept multiple values possible values: value not required name - specify a name for the element used in the form submission possible values: "string" required - specify that the user is required to choose an option possible values: value not required size - specify how many options are showing in the list possible values: "integer"

Official Documentation

http://www.w3.org/TR/html/forms.html#the-select-element

HTML

Elements

aabbraddressareaasidearticleaudiobbasebdobdiblockquotebodybrbuttoncanvascaptioncitecodecolcolgroupdatadatalistdddeldetailsdfndialogdivdldtemembedfieldsetfigcaptionfigurefooterformh1 h2 h3 h4 h5 h6headheaderhrhtmliiframeimginputinskbdkeygenlabellegendlilinkmainmapmarkmetameternavnoscriptobjectoloptgroupoptionoutputpparampreprogressqrb rp rt rtc rubyssampscriptsectionselectsmallsourcespanstrongstylesub supsummarytabletbodytdtemplatetextareatfootththeadtimetitletrtrackuulvarvideowbr