Mozilla XUL Element and Script Reference

Contents  Quick Reference


A command element can be used to invoke an operation that can come from multiple sources. For example, a clipboard paste operation can be invoked from the Edit menu, a context menu and by pressing a keyboard shortcut. You attach the code to the command using the oncommand attribute. It will be called no matter how it is invoked by the user. In addition, disabling the command will automatically disable the menu items and keyboard shortcuts.


Attributes inherited from XUL Element


If you set the disabled attribute to true, any menu items and keys attached to the command become disabled. If you set the attribute to false, or preferably, remove it, the menu items and keys become enabled.


The label inherited by the menu items and keys that are attached to the command.


This event handler is called when the command is activated. This occurs when a use selects a menu item or presses a keyboard shortcut attached to the command.

Properties and Methods:

Properties and Methods inherited from XUL Element