Search results
Definition and Usage. The <optgroup> tag is used to group related options in a <select> element (drop-down list). If you have a long list of options, groups of related options are easier to handle for a user.
- Label
W3Schools offers free online tutorials, references and...
- Option
Definition and Usage. The <option> tag defines an option in...
- Ol
W3Schools offers free online tutorials, references and...
- HTML
The disabled attribute can be set to keep a user from...
- OptionGroup Object
OptionGroup Object. The OptionGroup object represents an...
- The optgroup element
The optgroup element. The optgroup tag is used to group...
- Try It Yourself
W3Schools Tryit Editor. ×. Change OrientationSave CodeChange...
- Label
OptionGroup Object. The OptionGroup object represents an HTML <optgroup> element. Access an OptionGroup Object. You can access an <optgroup> element by using getElementById (): Example. var x = document.getElementById("myOptgroup"); Try it Yourself » Create an OptionGroup Object.
The optgroup element. The optgroup tag is used to group related options in a drop-down list:
The disabled attribute can be set to keep a user from selecting the option-group until some other condition has been met (like selecting a checkbox, etc.). Then, a JavaScript is required to remove the disabled value, and make the option-group selectable.
W3Schools Tryit Editor. ×. Change OrientationSave CodeChange Theme, Dark/LightGo to Spaces.
25 lip 2024 · The <optgroup> HTML element creates a grouping of options within a <select> element.
Przykładowy element "optgroup" posiadający atrybut "label" o wartości "owoce", jak również elementy HTML znajdujące się w zawartości przykładowego elementu "optgroup", zostali wyłączeni z interakcji z użytkownikiem, ponieważ do wspomnianego elementu "optgroup" został dodany atrybut "disabled".