HTML - Option

About

option is an element used to define a value.

option can be contained in:

Example

For example, this select creates a drop-down list of colors:

<select>
  <option value="blue">Blue</option>
  <option value="yellow">yellow</option>
  <option value="red">Red</option>
  <option selected value="green">Green</option>
</select>

Documentation / Reference





Discover More
HTML - Optgroup element (Group of Option)

optgroup is an HTML element that group options within a select element. optgroup
HTML - datalist

datalist is a html element that creates a set of value permitted (a domain) that may be used in a input element by grouping options. It does not force a selection as the HTML select element does autocomplete...
How to use the Select HTML Element?

select is an HTML control form element used for selecting one or more value amongst a set of options. It creates a drop-down list used in a form that will set a scalar value from a list of options. ...
What are Form Control elements in HTML ?

control form elements are elements that are used specifically inside a form. They are used: to specify a key and a value. to layout the form to submit it or reset it field set [optional]...
What is an HTML Form?

form is an element that represents a user-submittable form. When parsed as HTML, a form element's start tag will imply a p element's end tag just before. The pizza order form (taken from the...



Share this page:
Follow us:
Task Runner