Element
Element
This page has been flagged with the following issues:
High-level issues:
W3C Recommendation
Summary
Represents an node of type element in the DOM.
Inherits from Node
Properties
| API Name | Summary |
|---|---|
| XMLDocument | |
| XMLNS attribute | |
| code | |
| error | |
| msInputStream | |
| oneTimeOnly | |
| onerror | |
| onload | |
| onloadend | |
| onloadstart | |
| onprogress | |
| readyState | |
| result | |
| size | |
| type | |
| media | |
| type | |
| children | Retrieves a live collection of child elements of an element. |
| classList | Reflects the class attribute as an ordered list of the whitespace separated class names and has convenience methods for add, remove, contains and more. |
| entities | |
| internalSubset | |
| notations | |
| ownerElement | |
| parent | |
| systemLanguage | |
| childElementCount | |
| firstElementChild | |
| htmlText | |
| isTextEdit | |
| lastElementChild | |
| nextElementSibling | |
| parentElement | |
| parentTextEdit | |
| previousElementSibling | |
| size | |
| type |
Methods
| API Name | Summary |
|---|---|
| msWriteProfilerMark | |
| querySelector | Returns the first element that matches the provided selector. |
| querySelectorAll | Returns a list of elements that match a provided selector. |
| getAdjacentText | Non standard. Gets a text from a given location around the edges of the element. |
| getAttributeNS | |
| getAttributeNode | Retrieves an attribute node by name. |
| getAttributeNodeNS | Gets an attribute object that matches the specified namespace and name. |
| hasAttribute | |
| hasAttributeNS | |
| msSetPointerCapture | |
| removeAttributeNS | |
| removeAttributeNode | |
| requestFullscreen | The requestFullscreen method provides a way for presenting web content using the user’s entire screen. The API lets you easily direct the browser to make an element — and its children, if any — occupy the full available screen space, without borders or other chrome elements. |
| requestPointerLock | requestPointerLock lets lock the target of mouse events to a single element while hiding the cursor. |
| scrollByLines | |
| scrollByPages | |
| scrollIntoView | Scrolls the page to the point where the element shows up. |
| scrollIntoViewIfNeeded | |
| setAttributeNS | |
| setAttributeNode | |
| setAttributeNodeNS | |
| setCapture | Non standard. Proprietary. Sets the mouse capture to the object that belongs to the current document. |
| releasePointerCapture | Releases a pointer captured by an element (using the setPointerCapture method). |
| setPointerCapture | Assigns a specified pointer to an element. This method is used to ensure that an element continues to receive pointer events even if the contact moves off the element. |
| RangeException | |
| createControlRange | |
| createRange | |
| inRange | |
| isEqual | |
| item (TextRange) | |
| item (controlRange) |
Events
Inherited from Node
Properties
| API Name | Summary |
|---|---|
| attributes | Associatve array containing the attributes of node. |
| childNodes | |
| firstChild | |
| lastChild | |
| localName | Retrieves the local name of the fully qualified XML declaration for a node. |
| namespaceURI | Retrieves the namespace URI of the fully qualified XML declaration for a node. |
| nextSibling | Retrieves the next child node of the parent of the node. |
| nodeName | Gets the name of a particular type of node. |
| nodeType | Retrieves the type of the requested node. |
| nodeValue | Gets or sets the value of a node. |
| ownerDocument | |
| parentNode | Retrieves the parent node in the document hierarchy. |
| prefix | Sets or retrieves the prefix of the fully qualified XML declaration for a node. |
| previousSibling | Retrieves the previous child node of the parent of the node. |
| textContent | Sets or retrieves the text content of a node and any child nodes. |
Methods
| API Name | Summary |
|---|---|
| appendChild | Appends an element as a child to the object. |
| cloneNode | Copies a reference to the object from the document hierarchy. |
| compareDocumentPosition | Compares the position of two nodes in a document. |
| empty | |
| hasAttributes | |
| hasChildNodes | |
| insertBefore | Inserts a node into the document hierarchy as a child node of a node. |
| isDefaultNamespace | Indicates whether or not a namespace is the default namespace for a document. |
| isEqualNode | Determines whether two nodes are equal in their type, name and namespace. |
| isSameNode | Determines if two nodes are the same node. |
| isSupported | Returns a value indicating whether or not the object supports a specific DOM standard. |
| lookupNamespaceURI | Gets the URI of the namespace associated with a namespace prefix, if any. |
| lookupPrefix | Gets the namespace prefix associated with a URI, if any. |
| normalize | Merges adjacent DOM objects to produce a normalized document object model. |
| removeChild | Removes a child node from a node. |
| removeNode | Non standard. Proprietary. Use removeChild instead. Removes a node from the document hierarchy. |
| replaceChild | Replaces an existing child node with a new child node. |
| replaceNode | Non standard. Proprietary. Replaces the node with another node. |
| swapNode | Non standard. Proprietary. Exchanges the location of two nodes in the document hierarchy. |
Events
No events.
Needs Examples: This section should include examples.
Notes
Elements may have attributes associated with them; use the attributes property to retrieve the set of all attributes for an element. There are methods on this object to retrieve either an attribute object by name (getAttributeNode) or an attribute value by name (getAttribute). In XML, where an attribute value may contain entity references, an attribute object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience.
Additional Members (MSDN)
The Element object has these types of members: Additional Events Additional Methods Additional Properties
Additional Events
The Element object has these events.
| Event | Description |
|---|---|
| onmspointercancel | Fires when the system cancels a pointer event. |
Additional Methods
The Element object has these methods.
| Method | Description |
|---|---|
| msGetRegionContent | Returns an array of Range instances corresponding to the content from the region flow that is positioned in the region. |
Additional Properties
The Element object has these properties.
| Property | Description |
|---|---|
| msContentZoomFactor | Gets or sets a value that indicates the content zoom factor. |
| msRegionOverflow | Determines if content fully fits into the region or not. |
Related specifications
| Specification | Status | Related Changes |
|---|---|---|
| DOM Level 3 Core | Recommendation | Section 1.4 |
Compatibility
Desktop
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? |
Mobile
| Feature | Android | BlackBerry | Chrome for mobile | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Opera Mini | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? | ? | ? | ? |
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here