html radio button selected code example

Example 1: default checked radio button

<input type="radio" name="imgsel" value="" checked>

Example 2: html radio button checked

<input type="radio" id="huey" name="drone" value="huey"
         checked> 
<!-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio-->

Example 3: 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 4: radio by default selected

checked="checked"

Example 5: radio selected

//checked
  <input type="radio" id="huey" name="drone" value="huey"
         checked>

Example 6: 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:

Php Example