disabled attribute stops the user from interacting
with the form control. In this case, it prevents the user from clicking on
select, or tabbing to it with the keyboard, so the
user is prevented from changing the value.
The most likely
application for this attribute is to disable a
until such a time as some other condition has been met (for example, a
user clicks on a checkbox to confirm terms and conditions). At that point,
value, making the form control usable.
disabledattribute prevents the
selectfrom being used:
<form> <label for="favoritefood">Favorite food</label> <select name="favoritefood" id="favoritefood" disabled="disabled"> <option>Cheese</option> <option>Egg</option> <option>Cabbage</option> ⋮ </select> </form>
The only value this attribute can
It causes no compatibility issues, and has excellent support across all tested browsers.
There are no comments yet.