Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

option

The <option> element is used to designate the options that are available in a <select> or <datalist> element. You can also choose to group certain options together using the <optgroup> element if needed.

Code Example

Choose a technology: <select name="tech"> <option value="HTML">HTML</option> <option value="CSS">CSS</option> <option value="Javascript" disabled>Javascript</option> <option value="PHP">PHP</option> </select> open in code editor

Attributes

globals - the global attributes common to all elements possible values: see global attribute list disabled - specify that the option be disabled possible values: value not required label - specify a visible label possible values: "string" selected - specify that the option be selected by default possible values: value not required value - specify the value to be passed in the form submission possible values: "string"

Official Documentation

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

HTML

Elements

aabbraddressareaasidearticleaudiobbasebdobdiblockquotebodybrbuttoncanvascaptioncitecodecolcolgroupdatadatalistdddeldetailsdfndialogdivdldtemembedfieldsetfigcaptionfigurefooterformh1 h2 h3 h4 h5 h6headheaderhrhtmliiframeimginputinskbdkeygenlabellegendlilinkmainmapmarkmetameternavnoscriptobjectoloptgroupoptionoutputpparampreprogressqrb rp rt rtc rubyssampscriptsectionselectsmallsourcespanstrongstylesub supsummarytabletbodytdtemplatetextareatfootththeadtimetitletrtrackuulvarvideowbr