HTML <select> disabled eigenschap
Definitie en gebruik
disabled
De eigenschap is een boolse eigenschap.
Indien aanwezig, bepaalt het dat de keuzelijst moet worden gedeactiveerd.
De gedeactiveerde keuzelijst is niet beschikbaar en kan niet worden aangeklikt.
Can be set disabled
The disabled attribute is used to prevent users from using the dropdown list until other conditions are met (such as checking a checkbox, etc.). Then, JavaScript can remove the disabled value to make the dropdown list available.
Example
Disabled dropdown list:
<label for="cars">Please select a car brand:</label> <select name="cars" id="cars" disabled> <option value="audi">Audi</option> <option value="byd">BYD</option> <option value="geely">Geely</option> <option value="volvo">Volvo</option> </select>
Syntax
<select disabled>
Browser support
The numbers in the table indicate the first browser version to fully support this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 9.0 | Support | Support | Support |