DOMElement
Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.
Documentation Element by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
namespaceURI: StringThe namespace URI of the element, or null if it is no namespace.
Note: In Firefox 3.5 and earlier, HTML elements are in no namespace. In later versions, HTML elements are in the http://www.w3.org/1999/xhtml namespace in both HTML and XML trees. 1.9.2
prefix: StringA DOMString representing the namespace prefix of the element, or null if no prefix is specified.
localName: StringA DOMString representing the local part of the qualified name of the element.
tagName: StringReturns a String with the name of the tag for the given element.
id: StringIs a DOMString representing the id of the element.
className: StringIs a DOMString representing the class of the element.
classList: DOMTokenListReturns a DOMTokenList containing the list of class attributes.
attributes: NamedNodeMapReturns a NamedNodeMap object containing the assigned attributes of the corresponding HTML element.
title: Stringlang: Stringdir: Stringdataset: DOMStringMapinnerText: StringitemScope: BoolitemType: DOMTokenListitemId: StringitemRef: DOMTokenListitemProp: DOMTokenListproperties: HTMLPropertiesCollectionitemValue: DynamictabIndex: IntaccessKey: StringaccessKeyLabel: Stringdraggable: BoolcontentEditable: StringisContentEditable: BoolcontextMenu: MenuElementspellcheck: Boolstyle: CSSStyleDeclarationoncopy: haxe.Functiononcut: haxe.Functiononpaste: haxe.FunctionoffsetParent: ElementoffsetTop: IntoffsetLeft: IntoffsetWidth: IntoffsetHeight: IntscrollTop: IntA Number representing number of pixels the top of the document is scrolled vertically.
scrollLeft: IntIs a Number representing the left scroll offset of the element.
scrollWidth: IntReturns a Number representing the scroll view width of the element.
scrollHeight: IntReturns a Number representing the scroll view height of an element.
clientTop: IntReturns a Number representing the width of the top border of the element.
clientLeft: IntReturns a Number representing the width of the left border of the element.
clientWidth: IntReturns a Number representing the inner width of the element.
clientHeight: IntReturns a Number representing the inner height of the element.
scrollTopMax: IntReturns a Number representing the maximum top scroll offset possible for the element.
scrollLeftMax: IntReturns a Number representing the maximum left scroll offset possible for the element.
innerHTML: StringIs a DOMString representing the markup of the element's content.
outerHTML: StringIs a DOMString representing the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.
shadowRoot: ShadowRootReturns the open shadow root that is hosted by the element, or null if no open shadow root is present.
assignedSlot: SlotElementslot: StringReturns the name of the shadow DOM slot the element is inserted in.
onabort: haxe.Functiononblur: haxe.Functiononfocus: haxe.Functiononauxclick: haxe.Functiononcanplay: haxe.Functiononcanplaythrough: haxe.Functiononchange: haxe.Functiononclick: haxe.Functiononclose: haxe.Functionondblclick: haxe.Functionondrag: haxe.Functionondragend: haxe.Functionondragenter: haxe.Functionondragexit: haxe.Functionondragleave: haxe.Functionondragover: haxe.Functionondragstart: haxe.Functionondrop: haxe.Functionondurationchange: haxe.Functiononemptied: haxe.Functiononended: haxe.Functiononinput: haxe.Functiononinvalid: haxe.Functiononkeydown: haxe.Functiononkeypress: haxe.Functiononkeyup: haxe.Functiononload: haxe.Functiononloadeddata: haxe.Functiononloadedmetadata: haxe.Functiononloadend: haxe.Functiononloadstart: haxe.Functiononmousedown: haxe.Functiononmouseenter: haxe.Functiononmouseleave: haxe.Functiononmousemove: haxe.Functiononmouseout: haxe.Functiononmouseover: haxe.Functiononmouseup: haxe.Functiononwheel: haxe.FunctionReturns the event handling code for the wheel event. This is now implemented on GlobalEventHandlers.onwheel.
onpause: haxe.Functiononplay: haxe.Functiononplaying: haxe.Functiononprogress: haxe.Functiononratechange: haxe.Functiononreset: haxe.Functiononresize: haxe.Functiononscroll: haxe.Functiononseeked: haxe.Functiononseeking: haxe.Functiononselect: haxe.Functiononshow: haxe.Functiononstalled: haxe.Functiononsubmit: haxe.Functiononsuspend: haxe.Functionontimeupdate: haxe.Functiononvolumechange: haxe.Functiononwaiting: haxe.Functiononselectstart: haxe.Functionontoggle: haxe.Functiononpointercancel: haxe.Functiononpointerdown: haxe.Functiononpointerup: haxe.Functiononpointermove: haxe.Functiononpointerout: haxe.Functiononpointerover: haxe.Functiononpointerenter: haxe.Functiononpointerleave: haxe.Functionongotpointercapture: haxe.FunctionReturns the event handler for the gotpointercapture event type.
onlostpointercapture: haxe.FunctionReturns the event handler for the lostpointercapture event type.
onanimationcancel: haxe.Functiononanimationend: haxe.Functiononanimationiteration: haxe.Functiononanimationstart: haxe.Functionontransitioncancel: haxe.Functionontransitionend: haxe.Functionontransitionrun: haxe.Functionontransitionstart: haxe.Functiononwebkitanimationend: haxe.Functiononwebkitanimationiteration: haxe.Functiononwebkitanimationstart: haxe.Functiononwebkittransitionend: haxe.FunctionpreviousElementSibling: ElementnextElementSibling: Elementonerror: haxe.Functionchildren: HTMLCollectionfirstElementChild: ElementlastElementChild: ElementchildElementCount: Intontouchstart: haxe.Functionontouchend: haxe.Functionontouchmove: haxe.Functionontouchcancel: haxe.FunctionReturns an array of attribute names from the current element.
| Returns |
|---|
| Array<String> |
Retrieves the value of the named attribute from the current node and returns it as an Object.
| Name | Type |
|---|---|
name |
String |
| Returns |
|---|
| String |
Retrieves the value of the attribute with the specified name and namespace, from the current node and returns it as an Object.
| Name | Type |
|---|---|
namespace |
String |
localName |
String |
| Returns |
|---|
| String |
Toggles a boolean attribute, removing it if it is present and adding it if it is not present, on the specified element.
| Name | Type | Default |
|---|---|---|
name |
String | |
force |
Bool | (optional) |
| Returns |
|---|
| Bool |
Sets the value of a named attribute of the current node.
| Name | Type |
|---|---|
name |
String |
value |
String |
Sets the value of the attribute with the specified name and namespace, from the current node.
| Name | Type |
|---|---|
namespace |
String |
name |
String |
value |
String |
Removes the named attribute from the current node.
| Name | Type |
|---|---|
name |
String |
Removes the attribute with the specified name and namespace, from the current node.
| Name | Type |
|---|---|
namespace |
String |
localName |
String |
Returns a Boolean indicating if the element has the specified attribute or not.
| Name | Type |
|---|---|
name |
String |
| Returns |
|---|
| Bool |
Returns a Boolean indicating if the element has the specified attribute, in the specified namespace, or not.
| Name | Type |
|---|---|
namespace |
String |
localName |
String |
| Returns |
|---|
| Bool |
hasAttributes(): BoolReturns a Boolean indicating if the element has one or more HTML attributes present.
| Returns |
|---|
| Bool |
Returns the Element which is the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter.
| Name | Type |
|---|---|
selector |
String |
| Returns |
|---|
| Element |
Returns a Boolean indicating whether or not the element would be selected by the specified selector string.
| Name | Type |
|---|---|
selector |
String |
| Returns |
|---|
| Bool |
| Name | Type |
|---|---|
selector |
String |
| Returns |
|---|
| Bool |
getElementsByTagName(localName: String): HTMLCollectionReturns a live HTMLCollection containing all descendant elements, of a particular tag name, from the current element.
| Name | Type |
|---|---|
localName |
String |
| Returns |
|---|
| HTMLCollection |
getElementsByTagNameNS(namespace: String, localName: String): HTMLCollectionReturns a live HTMLCollection containing all descendant elements, of a particular tag name and namespace, from the current element.
| Name | Type |
|---|---|
namespace |
String |
localName |
String |
| Returns |
|---|
| HTMLCollection |
getElementsByClassName(classNames: String): HTMLCollectionReturns a live HTMLCollection that contains all descendants of the current element that possess the list of classes given in the parameter.
| Name | Type |
|---|---|
classNames |
String |
| Returns |
|---|
| HTMLCollection |
Inserts a given element node at a given position relative to the element it is invoked upon.
| Name | Type |
|---|---|
where |
String |
element |
Element |
| Returns |
|---|
| Element |
Inserts a given text node at a given position relative to the element it is invoked upon.
| Name | Type |
|---|---|
where |
String |
data |
String |
Designates a specific element as the capture target of future pointer events.
| Name | Type |
|---|---|
pointerId |
Int |
Releases (stops) pointer capture that was previously set for a specific PointerEvent.
| Name | Type |
|---|---|
pointerId |
Int |
| Name | Type |
|---|---|
pointerId |
Int |
| Returns |
|---|
| Bool |
Sets up mouse event capture, redirecting all mouse events to this element.
| Name | Type | Default |
|---|---|---|
retargetToElement |
Bool | false |
releaseCapture(): VoidRetrieves the node representation of the named attribute from the current node and returns it as an Attr.
| Name | Type |
|---|---|
name |
String |
| Returns |
|---|
| Attr |
Sets the node representation of the named attribute from the current node.
| Name | Type |
|---|---|
newAttr |
Attr |
| Returns |
|---|
| Attr |
Removes the node representation of the named attribute from the current node.
| Name | Type |
|---|---|
oldAttr |
Attr |
| Returns |
|---|
| Attr |
Retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an Attr.
| Name | Type |
|---|---|
namespaceURI |
String |
localName |
String |
| Returns |
|---|
| Attr |
Sets the node representation of the attribute with the specified name and namespace, from the current node.
| Name | Type |
|---|---|
newAttr |
Attr |
| Returns |
|---|
| Attr |
click(): Voidfocus(): Voidblur(): VoidgetClientRects(): DOMRectListReturns a collection of rectangles that indicate the bounding rectangles for each line of text in a client.
| Returns |
|---|
| DOMRectList |
getBoundingClientRect(): DOMRectReturns the size of an element and its position relative to the viewport.
| Returns |
|---|
| DOMRect |
Scrolls the page until the element gets into the view.
| Name | Type | Default |
|---|---|---|
arg |
Bool | (optional) |
scroll(?options: Null<ScrollToOptions>): Void| Name | Type | Default |
|---|---|---|
options |
Null<ScrollToOptions> | (optional) |
scrollTo(?options: Null<ScrollToOptions>): Void| Name | Type | Default |
|---|---|---|
options |
Null<ScrollToOptions> | (optional) |
scrollBy(?options: Null<ScrollToOptions>): Void| Name | Type | Default |
|---|---|---|
options |
Null<ScrollToOptions> | (optional) |
Parses the text as HTML or XML and inserts the resulting nodes into the tree in the position given.
| Name | Type |
|---|---|
position |
String |
text |
String |
Returns the first Node which matches the specified selector string relative to the element.
| Name | Type |
|---|---|
selectors |
String |
| Returns |
|---|
| Element |
Returns a NodeList of nodes which match the specified selector string relative to the element.
| Name | Type |
|---|---|
selectors |
String |
| Returns |
|---|
| NodeList |
attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRootAttatches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot.
| Name | Type |
|---|---|
shadowRootInitDict |
ShadowRootInit |
| Returns |
|---|
| ShadowRoot |
requestFullscreen(?options: Null<FullscreenOptions>): js.lib.Promise<Void>Asynchronously asks the browser to make the element full-screen.
| Name | Type | Default |
|---|---|---|
options |
Null<FullscreenOptions> | (optional) |
| Returns |
|---|
| js.lib.Promise<Void> |
requestPointerLock(): VoidAllows to asynchronously ask for the pointer to be locked on the given element.
A shortcut method to create and run an animation on an element. Returns the created Animation object instance.
| Name | Type | Default |
|---|---|---|
keyframes |
Dynamic | |
options |
Float | (optional) |
| Returns |
|---|
| Animation |
getAnimations(?filter: Null<AnimationFilter>): Array<Animation>Returns an array of Animation objects currently active on the element.
| Name | Type | Default |
|---|---|---|
filter |
Null<AnimationFilter> | (optional) |
| Returns |
|---|
| Array<Animation> |
before(nodes: haxe.extern.Rest): Void| Name | Type |
|---|---|
nodes |
haxe.extern.Rest |
after(nodes: haxe.extern.Rest): Void| Name | Type |
|---|---|
nodes |
haxe.extern.Rest |
replaceWith(nodes: haxe.extern.Rest): Void| Name | Type |
|---|---|
nodes |
haxe.extern.Rest |
remove(): VoidconvertQuadFromNode(quad: DOMQuad, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMQuad| Name | Type | Default |
|---|---|---|
quad |
DOMQuad | |
from |
Text | |
options |
Null<ConvertCoordinateOptions> | (optional) |
| Returns |
|---|
| DOMQuad |
convertRectFromNode(rect: DOMRectReadOnly, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMQuad| Name | Type | Default |
|---|---|---|
rect |
DOMRectReadOnly | |
from |
Text | |
options |
Null<ConvertCoordinateOptions> | (optional) |
| Returns |
|---|
| DOMQuad |
convertPointFromNode(point: DOMPointInit, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMPoint| Name | Type | Default |
|---|---|---|
point |
DOMPointInit | |
from |
Text | |
options |
Null<ConvertCoordinateOptions> | (optional) |
| Returns |
|---|
| DOMPoint |
prepend(nodes: haxe.extern.Rest): Void| Name | Type |
|---|---|
nodes |
haxe.extern.Rest |
append(nodes: haxe.extern.Rest): Void| Name | Type |
|---|---|
nodes |
haxe.extern.Rest |