HTML/Elements/input/radio

From Web Education Community Group
< HTML‎ | Elements‎ | input
Jump to: navigation, search

<input type="radio">

The radio button state represents a type attribute whose value is "radio" represents a selection of one item from a list of items (a radio button).


HTML Attributes

  • checked = boolean
    Gives the default checkedness of the input element.


  • name = string
    Gives the name of the input element.


  • required = boolean
    When specified, the element is required.


  • value = string
    Gives the default value of the input element.


Example

Example A

[try it]

<label><input type="radio" name="gender" value="male" checked> male</label>
<label><input type="radio" name="gender" value="female"> female</label>

Input radio01.png

HTML Reference

The HTML5 specification defines the Radio state in 4.10.7.1.17 RADIO BUTTON STATE.