HTML <select> Tag with the 'disabled' Attribute
<form id="myForm" action="/resources/html-forms-action.cfm">
<input name="someText">
<select name="Food" disabled>
<option value ="apples">Apples</option>
<option value ="bananas">Bananas</option>
<option value ="oranges">Oranges</option>
</select>
<button>Submit</button>
</form>
The above example demonstrates usage of the <select>
element with the disabled
attribute.
The disabled
attribute disables the <select>
control. The control won't accept changes from the user. Also, this <select>
element cannot receive focus and it will be skipped when tabbing.
Boolean Attribute
The disabled
attribute is a boolean attribute. If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace (i.e. either disabled
or disabled="disabled"
).
Possible values:
- [Empty string]
- disabled