Visit Mozilla.org

XUL:Attribute:accesskey

From MDC

« XUL Reference home

accesskey
Attribute of: button, checkbox, caption, description, label, listitem, menu, menuitem, menulist, tab, radio, toolbarbutton, textbox (Firefox autocomplete)
Type: character
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 element. This letter will typically be drawn underlined, although this behavior will be platform and theme specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the element will be activated from anywhere in the window. Although the value is case insensitive, a letter with the case matching the accesskey attribute will used if both cases exist in the label.

[edit] Example

Image:XUL_ref_accesskey_attr.png
<vbox>	
  <label value="Enter Name" accesskey="e" control="myName"/>
  <textbox id="myName"/>
  <button label="Cancel" accesskey="n"/>
  <button label="Ok" accesskey="O"/>
</vbox>

[edit] See also

label attribute, acceltext attribute