Element in DOM Level 2 Core
The Element interface represents an element in an HTML or XML document.
For more information see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-745549614.
Inherits from:
Inerhited by:
- HTMLElement
- SVGElement
- SVGAElement
- SVGAltGlyphDefElement
- SVGAltGlyphItemElement
- SVGAnimationElement
- SVGCircleElement
- SVGClipPathElement
- SVGColorProfileElement
- SVGComponentTransferFunctionElement
- SVGCursorElement
- SVGDefinitionSrcElement
- SVGDefsElement
- SVGDescElement
- SVGEllipseElement
- SVGFEBlendElement
- SVGFEColorMatrixElement
- SVGFEComponentTransferElement
- SVGFECompositeElement
- SVGFEConvolveMatrixElement
- SVGFEDiffuseLightingElement
- SVGFEDisplacementMapElement
- SVGFEDistantLightElement
- SVGFEFloodElement
- SVGFEGaussianBlurElement
- SVGFEImageElement
- SVGFEMergeElement
- SVGFEMergeNodeElement
- SVGFEMorphologyElement
- SVGFEOffsetElement
- SVGFEPointLightElement
- SVGFESpecularLightingElement
- SVGFESpotLightElement
- SVGFETileElement
- SVGFETurbulenceElement
- SVGFilterElement
- SVGFontElement
- SVGFontFaceElement
- SVGFontFaceFormatElement
- SVGFontFaceNameElement
- SVGFontFaceSrcElement
- SVGFontFaceUriElement
- SVGForeignObjectElement
- SVGGElement
- SVGGlyphElement
- SVGGlyphRefElement
- SVGGradientElement
- SVGHKernElement
- SVGImageElement
- SVGLineElement
- SVGMarkerElement
- SVGMaskElement
- SVGMetadataElement
- SVGMissingGlyphElement
- SVGMPathElement
- SVGPathElement
- SVGPatternElement
- SVGPolygonElement
- SVGPolylineElement
- SVGRectElement
- SVGScriptElement
- SVGStopElement
- SVGStyleElement
- SVGSVGElement
- SVGSwitchElement
- SVGSymbolElement
- SVGTextContentElement
- SVGTitleElement
- SVGUseElement
- SVGViewElement
- SVGVKernElement
- SVGFEFuncAElement
- SVGFEFuncBElement
- SVGFEFuncGElement
- SVGFEFuncRElement
- SVGTextPathElement
- SVGTextPositioningElement
- SVGAltGlyphElement
- SVGTextElement
- SVGTRefElement
- SVGTSpanElement
- SVGLinearGradientElement
- SVGRadialGradientElement
- SVGAnimateColorElement
- SVGAnimateElement
- SVGAnimateMotionElement
- SVGAnimateTransformElement
- SVGSetElement
- HTMLAnchorElement
- HTMLAppletElement
- HTMLAreaElement
- HTMLBaseElement
- HTMLBaseFontElement
- HTMLBodyElement
- HTMLBRElement
- HTMLButtonElement
- HTMLDirectoryElement
- HTMLDivElement
- HTMLDListElement
- HTMLFieldSetElement
- HTMLFontElement
- HTMLFormElement
- HTMLFrameElement
- HTMLFrameSetElement
- HTMLHeadElement
- HTMLHeadingElement
- HTMLHRElement
- HTMLHtmlElement
- HTMLIFrameElement
- HTMLImageElement
- HTMLInputElement
- HTMLIsIndexElement
- HTMLLabelElement
- HTMLLegendElement
- HTMLLIElement
- HTMLLinkElement
- HTMLMapElement
- HTMLMenuElement
- HTMLMetaElement
- HTMLModElement
- HTMLObjectElement
- HTMLOListElement
- HTMLOptGroupElement
- HTMLOptionElement
- HTMLParagraphElement
- HTMLParamElement
- HTMLPreElement
- HTMLQuoteElement
- HTMLScriptElement
- HTMLSelectElement
- HTMLStyleElement
- HTMLTableCaptionElement
- HTMLTableCellElement
- HTMLTableColElement
- HTMLTableElement
- HTMLTableRowElement
- HTMLTableSectionElement
- HTMLTextAreaElement
- HTMLTitleElement
- HTMLUListElement
Instance Properties
| name | type | description |
|---|---|---|
| attributes | NamedNodeMap | (read only) [from Node] |
| childNodes | NodeList | (read only) [from Node] |
| firstChild | Node | (read only) [from Node] |
| lastChild | Node | (read only) [from Node] |
| localName | String | (read only) [from Node] |
| namespaceURI | String | (read only) [from Node] |
| nextSibling | Node | (read only) [from Node] |
| nodeName | String | (read only) [from Node] |
| nodeType | Number | (read only) [from Node] |
| nodeValue | String | [from Node] |
| ownerDocument | Document | (read only) [from Node] |
| parentNode | Node | (read only) [from Node] |
| prefix | String | [from Node] |
| previousSibling | Node | (read only) [from Node] |
| tagName | String | (read only) |
Instance Methods
Description
The Element interface represents an element in an HTML or XML document. Elements may have attributes associated with them; since the Element interface inherits from Node, the generic Node interface attribute attributes may be used to retrieve the set of all attributes for an element. There are methods on the Element interface to retrieve either an Attr object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an Attr 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.
Note: In DOM Level 2, the method normalize is inherited from the Node interface where it was moved.
Properties that are a Element
| name | object | description |
|---|---|---|
| documentElement | Document | (read only) |
| ownerElement | Attr | (read only) |
Methods that return a Element
| name | of object | description |
|---|---|---|
| call() | Selection | Find the first DOM element in the selection. |
| createElementNS(namespaceURI,qualifiedName) | Document | |
| getElementById(elementId) | SVGSVGElement | |
| getElementById(elementId) | Document | |
| node() | EnterSelection | Find the first DOM element in the selection. |
Arguments that are a Element
| name | in method | of object | description |
|---|---|---|---|
| container | mouse(container) | [d3] d3 | The HTML or SVG container element to find the coordinates relative to. |
| container | touches(container) | [d3] d3 | The HTML or SVG container element to find the coordinates relative to. |
| elt | getComputedStyle(elt,pseudoElt) | [css] ViewCSS | |
| elt | getOverrideStyle(elt,pseudoElt) | [css] DocumentCSS |