HTML Old School

Input radio

Radio buttons are used when we want to select one item from the list.

<form action="" method="POST" enctype="application/x-www-form-urlencoded">
 I want to buy just one thing:
 <br><input type="radio" name="fruit" value="apples"> APPLES
 <br><input type="radio" name="fruit" value="oranges" checked> ORANGES
 <br><input type="radio" name="fruit" value="bananas"> BANANAS
</form>

 

Example: 06radio.html

 

Radio attributes

1. name="string"

 

 

2. value="string"

 

 

3. checked

Defines checked checkbox by default.