Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translation(HTML): web/html/element/optgroup #2703

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions files/uk/web/html/element/optgroup/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: "<optgroup> – елемент групи варіантів"
slug: Web/HTML/Element/optgroup
page-type: html-element
browser-compat: html.elements.optgroup
---

{{HTMLSidebar}}

Елемент [HTML](/uk/docs/Web/HTML) **`<optgroup>`** створює групування варіантів усередині елемента {{HTMLElement("select")}}.

{{EmbedInteractiveExample("pages/tabbed/optgroup.html", "tabbed-standard")}}

> **Примітка:** Елементи optgroup не можна вкладати один в одного.

## Атрибути

Цей елемент приймає [глобальні атрибути](/uk/docs/Web/HTML/Global_attributes).

- `disabled`
- : Якщо задано цей Булів атрибут, то жоден з елементів цієї групи варіантів не може бути вибраним. Зазвичай браузери позначають такі контрольні елементи сірим кольором і не передають їм жодних браузерних подій, таких як клацання мишею або події, пов'язані з фокусом.
- `label`
- : Назва групи варіантів, яку браузер може використовувати при позначенні варіантів у користувацькому інтерфейсі. Цей атрибут є обов'язковим, якщо цей елемент використовується.

## Приклади

```html
<select>
<optgroup label="Група 1">
<option>Варіант 1.1</option>
</optgroup>
<optgroup label="Група 2">
<option>Варіант 2.1</option>
<option>Варіант 2.2</option>
</optgroup>
<optgroup label="Група 3" disabled>
<option>Варіант 3.1</option>
<option>Варіант 3.2</option>
<option>Варіант 3.3</option>
</optgroup>
</select>
```

### Результат

{{EmbedLiveSample("pryklady")}}

## Технічний підсумок

<table class="properties">
<tbody>
<tr>
<th scope="row">
<a href="/uk/docs/Web/HTML/Content_categories"
>Категорії вмісту</a
>
</th>
<td>Жодних.</td>
</tr>
<tr>
<th scope="row">Дозволений вміст</th>
<td>Нуль або більше елементів {{HTMLElement("option")}}.</td>
</tr>
<tr>
<th scope="row">Пропуск тега</th>
<td>
Початковий тег є обов'язковим. Кінцевий тег є необов'язковим, якщо після цього елемента зразу стоїть інший елемент <code>&#x3C;optgroup></code>, або якщо батьківський елемент не має далі вмісту.
</td>
</tr>
<tr>
<th scope="row">Дозволені батьківські елементи</th>
<td>Елемент {{HTMLElement("select")}}.</td>
</tr>
<tr>
<th scope="row">Неявна роль ARIA</th>
<td><a href="/uk/docs/Web/Accessibility/ARIA/Roles/group_role"><code>group</code></a></td>
</tr>
<tr>
<th scope="row">Дозволені ролі ARIA</th>
<td>Жодної дозволеної ролі</td>
</tr>
<tr>
<th scope="row">Інтерфейс DOM</th>
<td>{{domxref("HTMLOptGroupElement")}}</td>
</tr>
</tbody>
</table>

## Специфікації

{{Specifications}}

## Сумісність із браузерами

{{Compat}}

## Дивіться також

- Інші елементи, пов'язані з формами: {{HTMLElement("form")}}, {{HTMLElement("legend")}}, {{HTMLElement("label")}}, {{HTMLElement("button")}}, {{HTMLElement("select")}}, {{HTMLElement("datalist")}}, {{HTMLElement("option")}}, {{HTMLElement("fieldset")}}, {{HTMLElement("textarea")}}, {{HTMLElement("input")}}, {{HTMLElement("output")}}, {{HTMLElement("progress")}} і {{HTMLElement("meter")}}.
Loading