html radio buttons only select one code example

Example 1: radio buttons html

<input type="radio" name="gender" value="male"> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other

Example 2: html radio only one checked

<!--Just manke both names equal -->
<input type="radio" name="options" id="1"/>
<input type="radio" name="options" id="2"/>

Example 3: how to add select only one radio button in html

<input type="radio" name="nameA" id="nameA" value="nameA">
<label for="nameA">Choice A</label>
<input type="radio" name="nameB" id="nameB" value="nameB">
<label for="nameB">Choice B</label>

Tags:

Css Example