English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML: <select> disabled attribute

<select disabled="disabled" attribute is a boolean attribute, the disabled attribute specifies that the dropdown list should be disabled. A disabled dropdown list is not usable and cannot be clicked.

 HTML <select> tag

Online Example

Disabled Dropdown List:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8">-8"> 
<title>HTML: <select> disabled attribute usage</title>-基础教程(oldtoolbag.com)</option>/title> 
</head>
<body>
<select disabled>
<option value="php">PHP</option>/option>
<option value="java">Java</option>/option>
<option value="rust">Rust</option>/option>
<option value="python">Python</option>/option>
</select>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the disabled attribute.

Definition and Usage

The disabled attribute is a boolean attribute.

The disabled attribute specifies that the dropdown list should be disabled.

The disabled dropdown list is not available and cannot be clicked.

The disabled dropdown list is not available and cannot be clicked. The disabled attribute specifies that the dropdown list should be disabled. The disabled attribute is a boolean attribute. The disabled attribute can be set until certain conditions are met (such as checking a checkbox), then the user's use of the dropdown list is restored. Then, you can use JavaScript to remove the value of the disabled attribute to make the dropdown list available.

HTML 4.01 With HTML5Differences

None.

Differences between HTML and XHTML

In XHTML, attribute shorthand is prohibited, the disabled attribute must be defined as <select disabled="disabled">.

Syntax

<select disabled>
 HTML <select> tag