Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <select> disabled Attribute

The disabled attribute on a <select> tag disables the select element.

The dropdown control appears grayed out and is unusable.

Example

#

A <select> element with a disabled attribute.
This dropdown is unusable and its selected value is not included during form submission.


<form action="/tutorial/action.html">
  <select name="size" disabled>
    <option value="">-- Select a Size --</option>
    <option value="small">Small</option>
    <option value="medium">Medium</option>
    <option value="large">Large</option>
  </select><br />

  <button type="submit">Submit</button>
</form>

Using disabled

The disabled attribute specifies that the select control is disabled.

The select control appears grayed out and does not respond to user actions.

Disabled select controls are excluded from form submission.


Syntax

<select disabled>
or
<select disabled="disabled">

Values

#

Value Description
disabled Use value 'disabled' or no value at all. Both are valid.

Browser support

Here is when disabled support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <select>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides