![帆软单选按钮实例](https://img-blog.csdnimg.cn/img_convert/c7c200b6a1c016dc2350b4c3190a1dc3.png)
帆软单选按钮实例
In the old times, radios have some buttons to change stations that have saved to a specific button. HTML also provides radio buttons in order to one of the radio buttons in a group of them. Radio buttons in HTML are defined with the <input> tag because the Radio button is referred to as an input from the user.
在过去,收音机具有一些按钮来更改已保存为特定按钮的电台。 HTML还提供了单选按钮,以便于一组单选按钮中的一个。 HTML中的单选按钮是用<input>标记定义的,因为单选按钮被称为来自用户的输入。
单选按钮标签 (Radio Button Tag)
We will define a radio button with the <input> tag by providing the type
as radio
like below. Radio button tag does not have an enclosing tag like </input> etc.
我们将通过提供type
为radio
的type
(如下所示)来定义带有<input>标签的单选按钮。 单选按钮标签没有像</ input>这样的封闭标签。
<input type="radio">
单选按钮组 (Radio Button Group)
Radio buttons generally used as a group. Because the main usage case for the radio button is providing some choices to the user and the user selects one of them. So we generally provide multiple radio buttons as a group. In or der to create groups the radio buttons name attribute should be the same for all radio buttons in the same group. For example, if we want to ask the user age range we have to use the same name for all radio buttons like below.
单选按钮通常作为一个组使用。 因为单选按钮的主要用法是向用户提供一些选择,然后用户选择其中