--- title: Options taxonomy: category: docs process: twig: true never_cache_twig: true --- A traditional `` element that contains `` elements will be converted into data objects using the following rules: ``` { "text": "label attribute", "children": [ option data object, ... ], "element": HTMLOptGroupElement } ``` >>> Options sourced from [other data sources](/data-sources) must conform to this this same internal representation. See ["The Select2 data format"](/data-sources/formats) for details. ## Dropdown option groups In HTML, `` element: ``` ``` Select2 will automatically pick these up and render them appropriately in the dropdown. ### Hierarchical options Only a single level of nesting is allowed per the HTML specification. If you nest an `` within another ``, Select2 will not be able to detect the extra level of nesting and errors may be triggered as a result. Furthermore, `` elements **cannot** be made selectable. This is a limitation of the HTML specification and is not a limitation that Select2 can overcome. If you wish to create a true hierarchy of selectable options, use an `` and [change the style with CSS](http://stackoverflow.com/q/30820215/359284#30948247). Please note that this approach may be considered "less accessible" as it relies on CSS styling, rather than the semantic meaning of ``, to generate the effect. ## Disabling options Select2 will correctly handle disabled options, both with data coming from a standard select (when the `disabled` attribute is set) and from remote sources, where the object has `disabled: true` set.


```

```