In HTML and XML, an element is an individual component of a document. Documents are composed of a tree of elements and other nodes, such as text nodes. Each element can have attributes specified. Elements can also have content, including other elements and text. Elements often represent semantics, or meaning. For example, the
<title> element represents the title of the document. In code, elements are represented by tags.
Every instance of this interface will, in practice, also implement EventTarget, so those members are also documented here.
These properties are available on all Element instances.
These methods are available on all Element instances.
|Parameter list||type (string), listener (function), useCapture (boolean)|
|Standard||DOM Level 2 Events, DOM Level 3 Events|
Registers listener to be called when an event of the specified type occurs on this element or a descendant. (type does not start with "on.") useCapture indicates which phases the listener may be invoked in. When in doubt, pass
false as the third parameter; see here for a detailed explanation.
For Internet Explorer 8 and before, see attachEvent below.
|Parameter list||type (string), listener (function)|
Registers listener to be called when an event of the specified type occurs on this element or a descendant. (type does start with "on.") This method is essentially equivalent to calling addEventListener with
false as the third parameter, except that
this === window is always true within the listener, and
event is a global variable.
|Parameter list||tagName (string)|
|Standard||DOM Level 1 Core, DOM Level 2 Core|
Finds every descendant of this element which has the specified tagName and is contained by the current element. The asterisk ("*") matches all elements below this one.
|Parameter list||tagName (string), namespace (string)|
|Standard||DOM Level 2 Core|
Finds every descendant of this element which has the specified tagName and namespace and is contained by the current element. If the name is only the asterisk ("*"), all elements below this one in the specified namespace will be returned.
|This page uses Creative Commons Licensed content from Wikipedia (view authors).|