From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/html/element/optgroup/index.html | 128 ++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 files/ja/web/html/element/optgroup/index.html (limited to 'files/ja/web/html/element/optgroup') diff --git a/files/ja/web/html/element/optgroup/index.html b/files/ja/web/html/element/optgroup/index.html new file mode 100644 index 0000000000..69e32d411c --- /dev/null +++ b/files/ja/web/html/element/optgroup/index.html @@ -0,0 +1,128 @@ +--- +title: +slug: Web/HTML/Element/optgroup +tags: + - Element + - Forms + - HTML + - HTML forms + - Reference + - Web +translation_of: Web/HTML/Element/optgroup +--- +
{{HTMLRef}}
+ +

HTML の <optgroup> 要素は、ウェブフォームにおいて {{HTMLElement("select")}} 要素内の、選択肢 ({{HTMLElement("option")}}) のグループを作成します。

+ +
{{EmbedInteractiveExample("pages/tabbed/optgroup.html", "tabbed-standard")}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
コンテンツカテゴリなし
許可されている内容0 個以上の {{HTMLElement("option")}} 要素
タグの省略開始タグは必須。要素の直後に他の <optgroup> 要素が接続する場合、または親要素が他の内容を持たない場合、終了タグが省略可能となる。
許可されている親要素{{HTMLElement("select")}} 要素
暗黙の ARIA ロール{{ARIARole("group")}}
許可されている ARIA ロール許可されている role なし
DOM インターフェイス{{domxref("HTMLOptGroupElement")}}
+ +

{{Note("optgroup 要素を入れ子にすることはできません。")}}

+ +

属性

+ +

この要素にはグローバル属性があります。

+ +
+
{{htmlattrdef("disabled")}}
+
この論理属性が指定された場合、このオプショングループ内の項目のいずれも選択不能となります。多くの場合、ブラウザーはそのコントロールをグレーアウトで表示し、マウスクリックやフォーカスなど、いかなるイベントも受け付けなくなります。
+
{{htmlattrdef("label")}}
+
ブラウザーがユーザーインターフェイス上の選択肢にラベル付けするのに使用できるオプションのグループの名前。この要素を使用する場合には、この属性は必須です。
+
+ +

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

結果

+ +

{{EmbedLiveSample("Examples")}}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', 'forms.html#the-optgroup-element', '<optgroup>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'sec-forms.html#the-optgroup-element', '<optgroup>')}}{{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'interact/forms.html#h-17.6', '<optgroup>')}}{{Spec2('HTML4.01')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("html.elements.optgroup")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf