Att Command Radiogroup
## HTML radiogroup Attribute
The `` element and its `radiogroup` attribute were introduced in HTML5 to define a group of radio button commands within a menu structure.
This tutorial provides a comprehensive reference for the `radiogroup` attribute, including its syntax, usage, browser compatibility, and modern alternatives.
---
## Definition and Usage
The `radiogroup` attribute specifies the name of a group of commands that are toggled together. When one command in the group is selected, any other selected command in the same group is automatically deselected.
> **Note:** The `radiogroup` attribute can only be used when the `` element's `type` attribute is set to `"radio"` (`type="radio"`).
---
## Syntax
```html
```
### Attribute Values
| Value | Description |
| :--- | :--- |
| *groupname* | Specifies the name of the command group to be toggled when the command is activated (only applicable when `type="radio"`). |
---
## Code Example
Below is an example of how the `radiogroup` attribute is structured to create a text alignment selection menu:
```html
```
---
## Browser Support and Current Status
Historically, the `` element and its `radiogroup` attribute faced extremely limited adoption.
| Feature | Chrome | Firefox | Safari | Edge | Opera |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **`` / `radiogroup`** | Not Supported | Not Supported | Not Supported | Not Supported | Not Supported |
### Important Specification Note
The `` element has been **deprecated and removed** from the W3C and WHATWG HTML living standards. It is highly recommended **not to use** this element or its attributes in modern web production environments.
---
## Modern Alternatives
To achieve the same functionality (a mutually exclusive group of options) in modern, standard-compliant web development, you should use standard HTML `` elements with `type="radio"`.
### Standard Compliant Example:
```html
```
### Why use the standard alternative?
* **Full Browser Support:** Works seamlessly across all legacy and modern browsers, including mobile devices.
* **Accessibility (a11y):** Screen readers natively understand `` and `
YouTip