項 目 | 説 明 |
---|---|
記述形式 | <optgroup>~</optgroup> |
対応ブラウザー | H4+ / e6+ / N6+ / Fx1+ / Op6+ / Ch1+ / Sa1+ |
種 類 (カテゴリー) |
なし |
置ける場所 | select要素の子要素 |
内包要素 (コンテンツ・モデル) |
0個以上の option要素 (コンテンツ・モデル: 直接指定) |
<optgroup> は,<option> をグループ化します。 グループのラベルとして label属性で指定した文字が表示されます。
IE6.0 や Netscape 6.0 からサポートされているようです。 対応したブラウザーでは,メニューが階層化されて表示されます。
リストの選択項目の数が多いときなどに便利な機能です。
種 類 | 名 称 |
---|---|
【固有属性】 | disabled, label |
【グローバル属性】 | accesskey,class,contenteditable *,
dir, hidden *,id, lang,spellcheck *,style, tabindex,title,translate * |
【ARIA role属性】 で 指定可能な値 (役割) |
なし |
【ARIA aria-* 属性】 で 指定可能なもの |
ARIA グローバル状態とプロパティ |
種 類 | 名 称 |
---|---|
【よく使うもの】 | color,background-color,font,font-size,font-family |
HTMLソース | |
---|---|
HTML <body> ~ </body> |
<select> <optgroup label="Internet Explorer"> <option>Internet Explorer 3.* <option>Internet Explorer 4.* <option>Internet Explorer 5.* <option>Internet Explorer 6.* </optgroup> <optgroup label="Netscape Browser"> <option>Netscape Navigator 3.* <option>Netscape Communicator 4.* <option>Netscape 6.* </optgroup> <optgroup label="Other"> <option>その他 </optgroup> </select> |
ブラウザー 表示例 |
---|