Mozilla XUL Element and Script Reference

Contents  Quick Reference


Declares a JavaScript method that is added to the element's object. The method may take arguments, declared with the parameter element.

For example, an element that allows text to be selected might have getSelected and setSelected methods.

The example below is a method toUpper that, when called, will make the value attribute uppercase.


    <method name="toUpper">
        var v = this.getAttribute("value");
        if (v != null) this.setAttribute("value",v.toUpperCase());


Attributes inherited from Element


The style class of the xbl:method. Multiple classes may be specified by separating them with spaces.


A unique identifier so that you can identify the xbl:method with. You can use this as a parameter to getElementById and other DOM functions and to reference the element in style sheets.


The name of the method, which is the name used in a script. For example, a method named setSize can accessed with object.setSize().