nsIDOMXULElement

by 3 contributors:

Represents a XUL element within the DOM.
28
Introduced
Gecko 1.0
Inherits from: nsIDOMElement Last changed in Gecko 1.9 (Firefox 3)

Method overview

void blur();
void click();
void doCommand();
void focus();
nsIDOMNodeList getElementsByAttribute(in DOMString name, in DOMString value);
nsIDOMNodeList getElementsByAttributeNS(in DOMString namespaceURI, in DOMString name, in DOMString value);

Attributes

Attribute Type Description
align DOMString Gets/sets the value of the element's align attribute.
allowEvents boolean true if the element's allowevents attribute is the string "true", otherwise false. Removes the attribute if you set it to false.
boxObject nsIBoxObject Read only. Gets or creates a box object for the element; browser, editor, iframe, listbox, menu, menupopup, scrollbox, tooltip and tree elements receive specialized box objects allowing access to additional properties not normally available from script.
builder nsIXULTemplateBuilder Read only. Retrives the element's template builder, if it has a template.
className DOMString Gets/sets the value of the element's class attribute.
collapsed boolean true if the element's collapsed attribute is the string "true", otherwise false. Removes the attribute if you set it to false.
contextMenu DOMString Gets/sets the value of the element's contextmenu attribute.
controllers nsIControllers Read only. Returns an nsIControllers object that additional controllers may be appended to so as to provide focus-specific actions for commands.
database nsIRDFCompositeDataSource Read only. Returns the template builder's database, if it is an RDF template.
datasources DOMString Gets/sets the value of the element's datasources attribute.
dir DOMString Gets/sets the value of the element's dir attribute.
flex DOMString Gets/sets the value of the element's flex attribute.
flexGroup DOMString Gets/sets the value of the element's flexgroup attribute.
height DOMString Gets/sets the value of the element's height attribute.
hidden boolean true if the element's hidden attribute is the string "true", otherwise false. Removes the attribute if you set it to false.
id DOMString Gets/sets the value of the element's id attribute.
left DOMString Gets/sets the value of the element's left attribute.
maxHeight DOMString Gets/sets the value of the element's maxheight attribute.
maxWidth DOMString Gets/sets the value of the element's maxwidth attribute.
menu DOMString Gets/sets the value of the element's menu attribute.
minHeight DOMString Gets/sets the value of the element's minheight attribute.
minWidth DOMString Gets/sets the value of the element's minwidth attribute.
observes DOMString Gets/sets the value of the element's observes attribute.
ordinal DOMString Gets/sets the value of the element's ordinal attribute.
orient DOMString Gets/sets the value of the element's orient attribute.
pack DOMString Gets/sets the value of the element's pack attribute.
persist DOMString Gets/sets the value of the element's persist attribute.
ref DOMString Gets/sets the value of the element's ref attribute.
resource nsIRDFResource Read only. Returns the nsIRDFResource corresponding to the element's ref or id attribute, if any.
statusText DOMString Gets/sets the value of the element's statustext attribute.
style nsIDOMCSSStyleDeclaration Read only. Obsolete since Gecko 1.9 Returns an object that may be used to read or write individual CSS style properties for the element.
tooltip DOMString Gets/sets the value of the element's tooltip attribute.
tooltipText DOMString Gets/sets the value of the element's tooltiptext attribute.
top DOMString Gets/sets the value of the element's top attribute.
width DOMString Gets/sets the value of the element's width attribute.

Methods

blur()

Attempts to remove focus from the element.

void blur();
Parameters

None.

click()

Unless the element is disabled, sends mouse events that simulate the effect of clicking the mouse on the element, then calls the doCommand() method.

void click();
Parameters

None.

doCommand()

Generates and dispatches a basic command event, as if the element was clicked with no keyboard modifiers.

void doCommand();
Parameters

None.

focus()

Attempts to set focus to the element; will not work for example for disabled elements.

void focus();
Parameters

None.

getElementsByAttribute()

Searches the DOM subtree for elements with the given attribute that are not in a namespace.

nsIDOMNodeList getElementsByAttribute(
  in DOMString name,
  in DOMString value
);
Parameters
name
The name of the attribute to search for.
value
The value of the attribute to search for, or "*" to search for the attribute without regard to the value.
Return value

A list of elements with matching attributes that have no namespace. Starting in Gecko 1.8 this is a live list of elements rather than a snapshot.

Requires Gecko 1.9 (Firefox 3)

getElementsByAttributeNS()

Searches the DOM subtree for elements with the given attribute in the given namespace.

nsIDOMNodeList getElementsByAttributeNS(
  in DOMString namespaceURI,
  in DOMString name,
  in DOMString value
);
Parameters
namespaceURI
The namespace of the attribute to search for, or "*" to search attributes in all namespaces.
name
The name of the attribute to search for.
value
The value of the attribute to search for, or "*" to search for the attribute without regard to the value.
Return value 

A list of elements with matching attributes.

Document Tags and Contributors

Contributors to this page: Sheppy, Neil, trevorh
Last updated by: Sheppy,