Code Example For Input Type Radio (And What It Defines In A Form)

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Value of
How To Define Input Type In HTML (All The Values And Attributes)
What does Code Example For Input Type Radio (And What It Defines In A Form) do?
Defines a circular selection button in a form.

Code Example

<form>
 <p>Check the languages you are most proficient in.</p>
 <input type="radio" name="chooseone" value="HTML"><label for="HTML"> HTML</label><br>
 <input type="radio" name="chooseone" value="CSS"><label for="CSS"> CSS</label><br>
 <input type="radio" name="chooseone" value="JS"><label for="JS"> JS</label><br>
 <input type="radio" name="chooseone" value="PHP"><label for="PHP"> PHP</label><br>
 <input type="radio" name="chooseone" value="Ruby"><label for="Ruby"> Ruby</label><br>
 <input type="radio" name="chooseone" value="INTERCAL"><label for="INTERCAL"> INTERCAL</label><br>
</form>

Check the languages you are most proficient in.







The radio input type displays a radio button that the user can toggle on and off. radio differs from checkbox in the way it is displayed.

When building a list of radio buttons, the name attribute must be identical for each option in the list. This ensures that only one radio input in the group can be selected.

When the form is submitted, it will include the contents of the value attribute corresponding to the selected radio button.

Claire is seasoned technical writer, editor, and HTML enthusiast. She writes for HTML.com and runs a content agency, Red Robot Media.

Browser Support for radio

iefirefoxchromeedgesafariopera
AllAllAllAllAllAll