We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

翻譯不完整。請協助 翻譯此英文文件


In a Web form, the HTML <optgroup> element  creates a grouping of options within a <select> element.

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 parent elements A <select> element.
DOM interface HTMLOptGroupElement

註: Optgroup elements may not be nested.


This element includes the global attributes.

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.
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.


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



Specification Status Comment
HTML Living Standard
The definition of '<optgroup>' in that specification.
Living Standard  
The definition of '<optgroup>' in that specification.
HTML 4.01 Specification
The definition of '<optgroup>' in that specification.


We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

功能 Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
基本 1.0 (Yes) (Yes) (Yes) (Yes)
功能 Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
基本 (Yes) (Yes) (Yes) (Yes) (Yes)



 此頁面的貢獻者: alk03073135
 最近更新: alk03073135,