From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/html/element%2Foptgroup.html | 119 +++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 devdocs/html/element%2Foptgroup.html (limited to 'devdocs/html/element%2Foptgroup.html') diff --git a/devdocs/html/element%2Foptgroup.html b/devdocs/html/element%2Foptgroup.html new file mode 100644 index 00000000..15a7eea5 --- /dev/null +++ b/devdocs/html/element%2Foptgroup.html @@ -0,0 +1,119 @@ +

<optgroup>: The Option Group element

The <optgroup> HTML element creates a grouping of options within a <select> element.

+

Try it

+
+

Note: Optgroup elements may not be nested.

+
+

Attributes

+
+

This element includes the global attributes.

disabled

If this Boolean attribute is set, none of the items in this option group is selectable. Often browsers grey out such control and it won't receive any browsing events, like mouse clicks or focus-related ones.

label

The name of the group of options, which the browser can use when labeling the options in the user interface. This attribute is mandatory if this element is used.

+
+

Examples

+
+

html

+
<select>
+  <optgroup label="Group 1">
+    <option>Option 1.1</option>
+  </optgroup>
+  <optgroup label="Group 2">
+    <option>Option 2.1</option>
+    <option>Option 2.2</option>
+  </optgroup>
+  <optgroup label="Group 3" disabled>
+    <option>Option 3.1</option>
+    <option>Option 3.2</option>
+    <option>Option 3.3</option>
+  </optgroup>
+</select>
+
+
+

Result

+
+ + +
+

Technical summary

+
Content categories None.
Permitted content Zero or more <option> elements.
Tag omission The start tag is mandatory. The end tag is optional if this element is immediately followed by another <optgroup> element, or if the parent element has no more content.
Permitted parents A <select> element.
Implicit ARIA role group
Permitted ARIA roles No role permitted
DOM interface HTMLOptGroupElement
+

Specifications

+
+ + +
Specification
HTML Standard
# the-optgroup-element
+

Browser compatibility

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on IOSSamsung Internet
optgroup11215.515≤44.418414≤3.21.0
disabled1121815≤44.418414≤3.21.0
label11215.515≤44.418414≤3.21.0
+

See also

+
+

+ © 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup +

+
-- cgit v1.2.3