Mozilla XUL Element and Script Reference

Contents  Quick Reference

Radio

An element that can be turned on and off. Radio buttons are almost always grouped together in groups. Only one radio button within the same group may be turned on at a time. The user can switch which radio button is turned on by selecting it with the mouse or keyboard. Other radio buttons in the same group are turned off. A label, specified with the label attribute may be added beside the radio button to indicate to the user as to its function.

Attributes:

Attributes inherited from XUL Element

accesskey

This should be set to a letter that is used as a shortcut key. This letter should be one of the characters that appears in the label text for the radio. This letter will typically be drawn underlined, although this behavior will be platform and skin specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the radio will be activated from anywhere in the window.

checked

Indicates whether the radio is checked or not.

command

Set to an id of a command element that is being observed by the element.

crop

If the label of the radio is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be placed in place of the cropped text. If the box direction is right to left (rtl), the cropping is reversed.

disabled

If this attribute is set to true, the radio is disabled. This is usually drawn with the text in grey. If the radio is disabled, the function of the button cannot be performed. Leave the attribute out entirely for a regular enabled button.

focused

This attribute is set to true if the radio element is focused.

image

The URL of the image to appear on the radio. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes.

label

The label that will appear on the radio. If this is left out, no text appears.

selected

This read only property is set to true if the radio button is currently the selected one. You can change the selected item by changing the selectedItem property of the radiogroup.

tabindex

value

A value associated with the radio. You may use it in a script for your own purposes.

Properties and Methods:

Properties and Methods inherited from XUL Element

accesskey

This should be set to a letter that is used as a shortcut key. This letter should be one of the characters that appears in the label text for the radio. This letter will typically be drawn underlined, although this behavior will be platform and skin specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the radio will be activated from anywhere in the window.

blur ( )

If the focus is on the element, it is removed. The focus is not automatically placed on any other element. Essentially, this is used to call the onblur handler.

checked

Gets and sets the value of the checked attribute.

command

Set to an id of a command element that is being observed by the element.

controllers

crop

If the label of the radio is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be placed in place of the cropped text. If the box direction is right to left (rtl), the cropping is reversed.

doCommand ( )

Executes the associated command.

focus ( )

Assigns the focus to the element, if it can accept the focus. The onfocus handler is called.

image

The URL of the image to appear on the radio. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes.

label

The label that will appear on the radio. If this is left out, no text appears.

radioGroup

Returns the enclosing radiogroup that the radio element is contained within, which may or may not be its direct parent.

selected

Gets and sets the value of the selected attribute.

value

A value associated with the radio. You may use it in a script for your own purposes.