A button that can be pressed by the user. Event handlers can be used to trap mouse, keyboard and other events. It is typically rendered as a grey outset rectangle.
Example:
<button label="Press Me"
oncommand="alert('You pressed me!'); return false;"/>
Attributes:
Attributes inherited from XUL Element
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 button. 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 button will be activated from anywhere in the window.
Set to an id of a command element that is being observed by the element.
If the label of the button 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.
Specifies which side of the button's label that its image is placed.
If this attribute is set to true, the button is disabled. This is usually drawn with the text in grey. If the button is disabled, the function of the button cannot be performed. The value may also be set to false for a regular active button. If this attribute is left out entirely, the button is enabled.
The URL of the image to appear on the button. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes.
The label that will appear on the button. If this is left out, no text appears.
Along with the dir attribute, the orient attribute is used to indicate where the button's image appears in relation to the the label.
The type of button. If this attribute is not present, a normal button is created. You can set the type attribute to the value 'menu' to create a button with a menu popup. This will typically cause the button to be displayed differently.
Properties and Methods:
Properties and Methods inherited from XUL Element
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 button. 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 button will be activated from anywhere in the window.
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.
Set to an id of a command element that is being observed by the element.
If the label of the button 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.
Gets and sets the value of the dir attribute.
Executes the associated command.
Assigns the focus to the element, if it can accept the focus. The onfocus handler is called.
The URL of the image to appear on the button. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes.
The label that will appear on the button. If this is left out, no text appears.
Gets and sets the value of the orient attribute.
The type of button. If this attribute is not present, a normal button is created. You can set the type attribute to the value 'menu' to create a button with a menu popup. This will typically cause the button to be displayed differently.