[编辑]
属性返回元素的属性集合. (DOM Core)(No IE)
返回包含当前元素的子元素的列表. (DOM Core)
获取/设置元素的类别. (HTML, XUL, ...)
元素内部的高度. (HTML-specific)
The width of the left border of an element in pixels. 不被普遍的支持. (HTML-specific)
The width of the top border of an element in pixels. 不被普遍的支持. (HTML-specific)
元素内部的宽度. (HTML-specific)
获取/设置元素的方向. (HTML, XUL)
返回当前元素第一个子元素. (DOM Core)
获取/设置元素的id. (HTML, XUL, ...)
获取/设置元素内部的HTML标记和内容. (HTML-specific)
指定元素的属性值和文本内容的语言. (HTML-specific)
返回当前元素最后一个子元素.(DOM Core)
返回列表内元素的数量.(例如:childNodes). (DOM Core, not part of Element interface)
Returns the local part of the qualified name of this node. (DOM Core)
获取/设置元素的name属性—并非所有此属性. (HTML-specific)
节点的命名空间 URI, 如果没有指定则为 null. (DOM Core)
返回节点的下一个兄弟节点. (DOM Core)
返回节点的名称. (DOM Core)
返回节点的类型. (DOM Core)
返回节点的值. (DOM Core)
返回元素的高度相对布局. (HTML-specific)
获取元素的左边界到它的offsetParent节点的左边界的水平距离(单位像素). (HTML-specific)
Returns a reference to the object in which the current element is offset (i.e., the parent element). (HTML-specific)
获取元素的上边界到它的offsetParent节点的上边界的垂直距离(单位像素). (HTML-specific)
返回元素的宽度相对布局. (HTML-specific)
返回元素所在的document对像. (DOM Core)
返回元素的父亲节点. (DOM Core)
返回当前元素的命名空间前缀, 如果未指定则返回 null. (DOM Core)
Returns the node immediately previous to the given one in the tree. (DOM Core)
Returns the height of the scroll view of an element. (HTML-specific)
Gets or sets the number of pixels that an element's content is scrolled to the left. (HTML-specific)
Gets/sets the distance between the top of an element and the topmost portion of its content currently visible. (HTML-specific)
Returns the width of the scroll view of an element. (HTML-specific)
Returns an object representing the declarations in the the element's style attribute. (HTML, XUL, ...)
获取/设置元素的TAB次序. (HTML)
返回元素的标签名称. (DOM Core)
Gets/sets the text content of an element including its descendants. (DOM Core)
[编辑]
方法
Allows the registration of event listeners on the event target. (DOM Events)
Inserts the specified node into the list of nodes on the current document. (DOM Core)
将键盘焦点从当前元素上移开. (HTML, XUL)
在当前元素上模拟一次单击. (HTML, XUL)
Returns a duplicate of the current node. (DOM Core)
Allows the dispatch of events into the implementation's event model. (DOM Events)
使当前元素获得焦点. (HTML, XUL)
返回当前节点中指定属性的值. (DOM Core)
Returns the value of the attribute with the given name and namespace. (DOM Core)
Returns the attribute of the element as a separate node. (DOM Core)
A namespace-aware version of getAttributeNode (DOM Core)
Returns the elements of a particular tag name that are descendants of the current element. (DOM Core)
Returns a boolean value indicating whether the element has the specified attribute or not. (DOM Core)
Returns a boolean value indicating whether the element has an attribute with the specified name and namespace. (DOM Core)
Returns a boolean value indicating whether the element has any attributes. (DOM Core)
Returns boolean value indicating whether the current element has children or not. (DOM Core)
Inserts a node before the current element in the DOM. (DOM Core)
Retrieves a node from a NodeList by index. (DOM Core, not part of the Element interface)
Puts the node and all of its subtree into a "normalized" form. (DOM Core)
Removes an attribute from the element. (DOM Core)
Removes the attribute with specified name and namespace from the element. (DOM Core)
Removes the specified attribute from the element. (DOM Core)
Removes a child node from the current element. (DOM Core)
Removes an event listener from the element. (DOM Events)
Replaces one child node on the current element with another. (DOM Core)
Scrolls the page until the element gets into the view. (HTML)
Adds a new attribute or changes the value of an existing attribute on the current element. (DOM Core)
Adds a new attribute or changes the value of an attribute with the given namespace and name. (DOM Core)
Adds a new attribute node to the current element. (DOM Core)
Adds a new attribute node with the specified namespace and name. (DOM Core)
Tests if this DOM implementation supports a particular feature.
[编辑]
事件句柄
对应HTML中的 'onxxx' 事件, 有一些相应的属性.
不像其他的属性, 这些属性是一些函数 (或其他实现了 EventListener 接口的对象) 而不是字符串. 事实上, 在HTML里分配一个事件就创建一个指定代码的函数包装. 比如以下的HTML代码:
假设 element 是指向这一个 div 的引用, 那么 element.onclick 相当于下面的效果:
function onclick(event) {
foo();
}
Note how the event object is passed as parameter event to this wrapper function.
Returns the event handling code for the blur event.
Returns the event handling code for the click event.
Returns the event handling code for the dblclick event.
Returns the event handling code for the focus event.
Returns the event handling code for the keydown event.
Returns the event handling code for the keypress event.
Returns the event handling code for the keyup event.
Returns the event handling code for the mousedown event.
Returns the event handling code for the mousemove event.
Returns the event handling code for the mouseout event.
Returns the event handling code for the mouseover event.
Returns the event handling code for the mouseup event.
Returns the event handling code for the resize event.