1. Home
  2. Computing & Technology
  3. Web Design / HTML

<input type="radio" />

By , About.com Guide

<input type="radio" /> Description:

The <input type="radio" /> tag puts radio buttons on form documents.

<input type="radio" /> Web Browser Support:
<input type="radio" /> Attributes:
<input type="radio" /> Usage:
  • standard radio button:
    <form>
    Do you understand?<br />
    Yes <input type="radio" name="understand" value="yes" />
    No <input type="radio" name="understand" value="no" />
    </form>
  • multiple radio buttons with the same name:
    <form>
    What type of pet do you have?
    cat <input type="radio" name="pet" value="cat">
    dog <input type="radio" name="pet" value="dog">
    rabbit <input type="radio" name="pet" value="rabbit" checked>
    </form>
  • radio button with some styles added:
    <form>
    <input type="radio" value="Me" style="background-color:#cc0000; color: #ffffff;" />
    </form>
<input type="radio" /> Special Notes:
  • Give several radio buttons the same name (as in example 2) to send a single value of a group to the server. This is the same as having a multiple choice question where only one answer is allowed.
More <input type="radio" /> Information:

Return to the <input /> Element
Return to XHTML Element (HTML Tags) Library

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.