HTMLSelectElement.disabled - Web APIs | MDN

  • Skip to main content
  • Skip to search
HTMLSelectElement: disabled property Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

  • Learn more
  • See full compatibility
  • Report feedback

The HTMLSelectElement.disabled property is a boolean value that reflects the disabled HTML attribute, which indicates whether the control is disabled. If it is disabled, it does not accept clicks. A disabled element is unusable and un-clickable.

In this article

  • Value
  • Examples
  • Specifications
  • Browser compatibility

Value

A boolean value.

Examples

HTML

html<label> Allow drinks? <input id="allow-drinks" type="checkbox" /> </label> <label for="drink-select">Drink selection:</label> <select id="drink-select" disabled> <option value="1">Water</option> <option value="2">Beer</option> <option value="3">Pepsi</option> <option value="4">Whisky</option> </select>

JavaScript

jsconst allowDrinksCheckbox = document.getElementById("allow-drinks"); const drinkSelect = document.getElementById("drink-select"); allowDrinksCheckbox.addEventListener("change", (event) => { drinkSelect.disabled = !event.target.checked; });

Result

Specifications

Specification
HTML# dom-fe-disabled

Browser compatibility

Help improve MDN

Was this page helpful to you? Yes No Learn how to contribute

This page was last modified on ⁨Sep 18, 2025⁩ by MDN contributors.

View this page on GitHub • Report a problem with this content Filter sidebar
  1. The HTML DOM API
  2. HTMLSelectElement
  3. Instance properties
    1. autocomplete
    2. disabled
    3. form
    4. labels
    5. length
    6. multiple
    7. name
    8. options
    9. required
    10. selectedIndex
    11. selectedOptions
    12. size
    13. type
    14. validationMessage
    15. validity
    16. value
    17. willValidate
  4. Instance methods
    1. add()
    2. checkValidity()
    3. item()
    4. namedItem()
    5. remove()
    6. reportValidity()
    7. setCustomValidity()
    8. showPicker()
  5. Inheritance
    1. HTMLElement
    2. Element
    3. Node
    4. EventTarget
  6. Related pages for HTML DOM
    1. BeforeUnloadEvent
    2. DOMStringMap
    3. ErrorEvent
    4. HTMLAnchorElement
    5. HTMLAreaElement
    6. HTMLAudioElement
    7. HTMLBRElement
    8. HTMLBaseElement
    9. HTMLBodyElement
    10. HTMLButtonElement
    11. HTMLCanvasElement
    12. HTMLDListElement
    13. HTMLDataElement
    14. HTMLDataListElement
    15. HTMLDialogElement
    16. HTMLDivElement
    17. HTMLDocument
    18. HTMLElement
    19. HTMLEmbedElement
    20. HTMLFieldSetElement
    21. HTMLFormControlsCollection
    22. HTMLFormElement
    23. HTMLFrameSetElement Deprecated
    24. HTMLHRElement
    25. HTMLHeadElement
    26. HTMLHeadingElement
    27. HTMLHtmlElement
    28. HTMLIFrameElement
    29. HTMLImageElement
    30. HTMLInputElement
    31. HTMLLIElement
    32. HTMLLabelElement
    33. HTMLLegendElement
    34. HTMLLinkElement
    35. HTMLMapElement
    36. HTMLMediaElement
    37. HTMLMenuElement
    38. HTMLMetaElement
    39. HTMLMeterElement
    40. HTMLModElement
    41. HTMLOListElement
    42. HTMLObjectElement
    43. HTMLOptGroupElement
    44. HTMLOptionElement
    45. HTMLOptionsCollection
    46. HTMLOutputElement
    47. HTMLParagraphElement
    48. HTMLPictureElement
    49. HTMLPreElement
    50. HTMLProgressElement
    51. HTMLQuoteElement
    52. HTMLScriptElement
    53. HTMLSourceElement
    54. HTMLSpanElement
    55. HTMLStyleElement
    56. HTMLTableCaptionElement
    57. HTMLTableCellElement
    58. HTMLTableColElement
    59. HTMLTableElement
    60. HTMLTableRowElement
    61. HTMLTableSectionElement
    62. HTMLTemplateElement
    63. HTMLTextAreaElement
    64. HTMLTimeElement
    65. HTMLTitleElement
    66. HTMLTrackElement
    67. HTMLUListElement
    68. HTMLUnknownElement
    69. HTMLVideoElement
    70. HashChangeEvent
    71. History
    72. ImageData
    73. Location
    74. MessageChannel
    75. MessageEvent
    76. MessagePort
    77. Navigator
    78. PageRevealEvent
    79. PageSwapEvent
    80. PageTransitionEvent
    81. Plugin Deprecated
    82. PluginArray Deprecated
    83. PromiseRejectionEvent
    84. RadioNodeList
    85. TimeRanges
    86. UserActivation
    87. ValidityState
    88. Window
    89. WorkletGlobalScope
  7. Guides
    1. Using microtasks in JavaScript with queueMicrotask()
    2. In depth: Microtasks and the JavaScript runtime environment

Từ khóa » Html A Tag Disabled