The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <INPUT> (PASSWORD) | Next Tag: <INPUT> (RESET) |


<INPUT> (RADIO)

Creates an radio button control that the user can activate in a form.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later
Notes:
  • Radio buttons always come in groups of two or more, and the user can only activate one button in the group at a time.
  • All related radio buttons must use the same name.
Attributes:
ACCESSKEY = "Text (single character)"
A character to use as a keyboard shortcut for selecting the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • The access key is invoked by using it as a key combination. For example, if you specify ACCESSKEY="P", then the user invokes the key by pressing Alt+P (Windows) or Cmd+P (Mac).

CHECKED
When present, displays the radio button as checked.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later 4.0 and later

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

DISABLED
Prevents the user from being able to click the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later 4.0 and later

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

NAME = "Text"
The name of the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

Notes:

  • The NAME attribute enables scripts to work with this control.
  • Again, all related radio buttons must use the same name. That name must be different from all other names used within the form.

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later 4.0 and later

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

TABINDEX = Positive integer
The control's position with the page's tabbing order.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • The "tabbing order" is the order in which page elements are selected when the user presses the Tab key.

TYPE = "Text"
The type of the INPUT tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 1.0 and later

Notes:

  • Use TYPE=RADIO.

VALUE = "Text"
The initial value assigned to the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

Notes:

  • This is the value that tells you which radio button was activated when the user submitted the form.
  • In a group of related radio buttons, each control should have a unique value.

Example:
<FORM ACTION="http://www.mcfedries.com/cgi-win/formtest.exe" METHOD=POST>
Which of the following best describes your political leanings:
<UL>
<INPUT TYPE=RADIO NAME="Politics" VALUE="Politics1" CHECKED>So far left, I'm right<BR>
<INPUT TYPE=RADIO NAME="Politics" VALUE="Politics2">Yellow Dog Democrat<BR>
<INPUT TYPE=RADIO NAME="Politics" VALUE="Politics3">Right down the middle<BR>
<INPUT TYPE=RADIO NAME="Politics" VALUE="Politics4">Country Club Republican<BR>
<INPUT TYPE=RADIO NAME="Politics" VALUE="Politics5">So far right, I'm left<BR>
</UL>
<P>
<INPUT TYPE=SUBMIT VALUE="Submit">
</FORM>
How It Looks:
Which of the following best describes your political leanings:
    So far left, I'm right
    Yellow Dog Democrat
    Right down the middle
    Country Club Republican
    So far right, I'm left


| Index | Previous Tag: <INPUT> (PASSWORD) | Next Tag: <INPUT> (RESET) |