nsIDOMXULElement 编辑

dom/interfaces/xul/nsIDOMXULElement.idlScriptable Represents a XUL element within the DOM. 66 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

AttributeTypeDescription
alignDOMStringGets/sets the value of the element's align attribute.
allowEventsbooleantrue if the element's allowevents attribute is the string "true", otherwise false. Removes the attribute if you set it to false.
boxObjectnsIBoxObjectRead 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.
buildernsIXULTemplateBuilderRead only. Retrives the element's template builder, if it has a template.
classNameDOMStringGets/sets the value of the element's class attribute.
collapsedbooleantrue if the element's collapsed attribute is the string "true", otherwise false. Removes the attribute if you set it to false.
contextMenuDOMStringGets/sets the value of the element's contextmenu attribute.
controllersnsIControllersRead only. Returns an nsIControllers object that additional controllers may be appended to so as to provide focus-specific actions for commands.
databasensIRDFCompositeDataSourceRead only. Returns the template builder's database, if it is an RDF template.
datasourcesDOMStringGets/sets the value of the element's datasources attribute.
dirDOMStringGets/sets the value of the element's dir attribute.
flexDOMStringGets/sets the value of the element's flex attribute.
flexGroupDOMStringGets/sets the value of the element's flexgroup attribute.
heightDOMStringGets/sets the value of the element's height attribute.
hiddenbooleantrue if the element's hidden attribute is the string "true", otherwise false. Removes the attribute if you set it to false.
idDOMStringGets/sets the value of the element's id attribute.
leftDOMStringGets/sets the value of the element's left attribute.
maxHeightDOMStringGets/sets the value of the element's maxheight attribute.
maxWidthDOMStringGets/sets the value of the element's maxwidth attribute.
menuDOMStringGets/sets the value of the element's menu attribute.
minHeightDOMStringGets/sets the value of the element's minheight attribute.
minWidthDOMStringGets/sets the value of the element's minwidth attribute.
observesDOMStringGets/sets the value of the element's observes attribute.
ordinalDOMStringGets/sets the value of the element's ordinal attribute.
orientDOMStringGets/sets the value of the element's orient attribute.
packDOMStringGets/sets the value of the element's pack attribute.
persistDOMStringGets/sets the value of the element's persist attribute.
refDOMStringGets/sets the value of the element's ref attribute.
resourcensIRDFResourceRead only. Returns the nsIRDFResource corresponding to the element's ref or id attribute, if any.
statusTextDOMStringGets/sets the value of the element's statustext attribute.
stylensIDOMCSSStyleDeclarationRead only. Obsolete since Gecko 1.9 Returns an object that may be used to read or write individual CSS style properties for the element.
tooltipDOMStringGets/sets the value of the element's tooltip attribute.
tooltipTextDOMStringGets/sets the value of the element's tooltiptext attribute.
topDOMStringGets/sets the value of the element's top attribute.
widthDOMStringGets/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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:108 次

字数:15197

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文