DOMElement
package js.html
extends Node › EventTarget
Available on js
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.
See also:
Variables
accessKey:String
read onlyaccessKeyLabel:String
read onlyassignedSlot:SlotElement
read onlyattributes:NamedNodeMap
Returns a NamedNodeMap
object containing the assigned attributes of the corresponding HTML element.
read onlychildElementCount:Int
read onlychildren:HTMLCollection
read onlyclassList:DOMTokenList
Returns a DOMTokenList
containing the list of class attributes.
className:String
Is a DOMString
representing the class of the element.
read onlyclientHeight:Int
Returns a Number
representing the inner height of the element.
read onlyclientLeft:Int
Returns a Number
representing the width of the left border of the element.
read onlyclientTop:Int
Returns a Number
representing the width of the top border of the element.
read onlyclientWidth:Int
Returns a Number
representing the inner width of the element.
contentEditable:String
read onlycontextMenu:MenuElement
read onlydataset:DOMStringMap
dir:String
draggable:Bool
read onlyfirstElementChild:Element
hidden:Bool
id:String
Is a DOMString
representing the id of the element.
innerHTML:String
Is a DOMString
representing the markup of the element's content.
innerText:String
read onlyisContentEditable:Bool
itemId:String
read onlyitemProp:DOMTokenList
read onlyitemRef:DOMTokenList
itemScope:Bool
read onlyitemType:DOMTokenList
itemValue:Dynamic
lang:String
read onlylastElementChild:Element
read onlylocalName:String
A DOMString
representing the local part of the qualified name of the element.
read onlynamespaceURI:String
The 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
read onlynextElementSibling:Element
read onlyoffsetHeight:Int
read onlyoffsetLeft:Int
read onlyoffsetParent:Element
read onlyoffsetTop:Int
read onlyoffsetWidth:Int
onabort:Function
onanimationcancel:Function
onanimationend:Function
onanimationiteration:Function
onanimationstart:Function
onauxclick:Function
onblur:Function
oncanplay:Function
oncanplaythrough:Function
onchange:Function
onclick:Function
onclose:Function
oncontextmenu:Function
oncopy:Function
oncut:Function
ondblclick:Function
ondrag:Function
ondragend:Function
ondragenter:Function
ondragexit:Function
ondragleave:Function
ondragover:Function
ondragstart:Function
ondrop:Function
ondurationchange:Function
onemptied:Function
onended:Function
onerror:Function
onfocus:Function
ongotpointercapture:Function
Returns the event handler for the gotpointercapture
event type.
oninput:Function
oninvalid:Function
onkeydown:Function
onkeypress:Function
onkeyup:Function
onload:Function
onloadeddata:Function
onloadedmetadata:Function
onloadend:Function
onloadstart:Function
onlostpointercapture:Function
Returns the event handler for the lostpointercapture
event type.
onmousedown:Function
onmouseenter:Function
onmouseleave:Function
onmousemove:Function
onmouseout:Function
onmouseover:Function
onmouseup:Function
onpaste:Function
onpause:Function
onplay:Function
onplaying:Function
onpointercancel:Function
onpointerdown:Function
onpointerenter:Function
onpointerleave:Function
onpointermove:Function
onpointerout:Function
onpointerover:Function
onpointerup:Function
onprogress:Function
onratechange:Function
onreset:Function
onresize:Function
onscroll:Function
onseeked:Function
onseeking:Function
onselect:Function
onselectstart:Function
onshow:Function
onstalled:Function
onsubmit:Function
onsuspend:Function
ontimeupdate:Function
ontoggle:Function
ontouchcancel:Function
ontouchend:Function
ontouchmove:Function
ontouchstart:Function
ontransitioncancel:Function
ontransitionend:Function
ontransitionrun:Function
ontransitionstart:Function
onvolumechange:Function
onwaiting:Function
onwebkitanimationend:Function
onwebkitanimationiteration:Function
onwebkitanimationstart:Function
onwebkittransitionend:Function
onwheel:Function
Returns the event handling code for the wheel
event. This is now implemented on GlobalEventHandlers.onwheel
.
outerHTML:String
Is 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.
read onlyprefix:String
A DOMString
representing the namespace prefix of the element, or null
if no prefix is specified.
read onlypreviousElementSibling:Element
read onlyproperties:HTMLPropertiesCollection
read onlyscrollHeight:Int
Returns a Number
representing the scroll view height of an element.
scrollLeft:Int
Is a Number
representing the left scroll offset of the element.
read onlyscrollLeftMax:Int
Returns a Number
representing the maximum left scroll offset possible for the element.
scrollTop:Int
A Number
representing number of pixels the top of the document is scrolled vertically.
read onlyscrollTopMax:Int
Returns a Number
representing the maximum top scroll offset possible for the element.
read onlyscrollWidth:Int
Returns a Number
representing the scroll view width of the element.
read onlyshadowRoot:ShadowRoot
Returns the open shadow root that is hosted by the element, or null if no open shadow root is present.
slot:String
Returns the name of the shadow DOM slot the element is inserted in.
spellcheck:Bool
read onlystyle:CSSStyleDeclaration
tabIndex:Int
read onlytagName:String
Returns a String
with the name of the tag for the given element.
title:String
Methods
after(nodes:Rest<Node>):Void
after(nodes:Rest<String>):Void
Throws:
null |
DOMError |
---|
animate(keyframes:Dynamic, ?options:Float):Animation
animate(keyframes:Dynamic, ?options:Null<KeyframeAnimationOptions>):Animation
A shortcut method to create and run an animation on an element. Returns the created Animation object instance.
Throws:
null |
DOMError |
---|
append(nodes:Rest<Node>):Void
append(nodes:Rest<String>):Void
Throws:
null |
DOMError |
---|
attachShadow(shadowRootInitDict:ShadowRootInit):ShadowRoot
Attatches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot
.
Throws:
null |
DOMError |
---|
before(nodes:Rest<Node>):Void
before(nodes:Rest<String>):Void
Throws:
null |
DOMError |
---|
blur():Void
Throws:
null |
DOMError |
---|
click():Void
closest(selector:String):Element
Returns the Element
which is the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter.
Throws:
null |
DOMError |
---|
convertPointFromNode(point:DOMPointInit, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMPoint
convertPointFromNode(point:DOMPointInit, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMPoint
convertPointFromNode(point:DOMPointInit, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMPoint
Throws:
null |
DOMError |
---|
convertQuadFromNode(quad:DOMQuad, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertQuadFromNode(quad:DOMQuad, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertQuadFromNode(quad:DOMQuad, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuad
Throws:
null |
DOMError |
---|
convertRectFromNode(rect:DOMRectReadOnly, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertRectFromNode(rect:DOMRectReadOnly, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertRectFromNode(rect:DOMRectReadOnly, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuad
Throws:
null |
DOMError |
---|
focus():Void
Throws:
null |
DOMError |
---|
getAnimations(?filter:Null<AnimationFilter>):Array<Animation>
Returns an array of Animation objects currently active on the element.
getAttribute(name:String):String
Retrieves the value of the named attribute from the current node and returns it as an Object
.
getAttributeNS(namespace:String, localName:String):String
Retrieves the value of the attribute with the specified name and namespace, from the current node and returns it as an Object
.
getAttributeNames():Array<String>
Returns an array of attribute names from the current element.
getAttributeNode(name:String):Attr
Retrieves the node representation of the named attribute from the current node and returns it as an Attr
.
getAttributeNodeNS(namespaceURI:String, localName:String):Attr
Retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an Attr
.
getBoundingClientRect():DOMRect
Returns the size of an element and its position relative to the viewport.
getClientRects():DOMRectList
Returns a collection of rectangles that indicate the bounding rectangles for each line of text in a client.
getElementsByClassName(classNames:String):HTMLCollection
Returns a live HTMLCollection
that contains all descendants of the current element that possess the list of classes given in the parameter.
getElementsByTagName(localName:String):HTMLCollection
Returns a live HTMLCollection
containing all descendant elements, of a particular tag name, from the current element.
getElementsByTagNameNS(namespace:String, localName:String):HTMLCollection
Returns a live HTMLCollection
containing all descendant elements, of a particular tag name and namespace, from the current element.
Throws:
null |
DOMError |
---|
hasAttribute(name:String):Bool
Returns a Boolean
indicating if the element has the specified attribute or not.
hasAttributeNS(namespace:String, localName:String):Bool
Returns a Boolean
indicating if the element has the specified attribute, in the specified namespace, or not.
hasAttributes():Bool
Returns a Boolean
indicating if the element has one or more HTML attributes present.
hasPointerCapture(pointerId:Int):Bool
insertAdjacentElement(where:String, element:Element):Element
Inserts a given element node at a given position relative to the element it is invoked upon.
Throws:
null |
DOMError |
---|
insertAdjacentHTML(position:String, text:String):Void
Parses the text as HTML or XML and inserts the resulting nodes into the tree in the position given.
Throws:
null |
DOMError |
---|
insertAdjacentText(where:String, data:String):Void
Inserts a given text node at a given position relative to the element it is invoked upon.
Throws:
null |
DOMError |
---|
matches(selector:String):Bool
Returns a Boolean
indicating whether or not the element would be selected by the specified selector string.
Throws:
null |
DOMError |
---|
prepend(nodes:Rest<Node>):Void
prepend(nodes:Rest<String>):Void
Throws:
null |
DOMError |
---|
querySelector(selectors:String):Element
Returns the first Node
which matches the specified selector string relative to the element.
Throws:
null |
DOMError |
---|
querySelectorAll(selectors:String):NodeList
Returns a NodeList
of nodes which match the specified selector string relative to the element.
Throws:
null |
DOMError |
---|
releaseCapture():Void
releasePointerCapture(pointerId:Int):Void
Releases (stops) pointer capture that was previously set for a specific PointerEvent
.
Throws:
null |
DOMError |
---|
remove():Void
removeAttribute(name:String):Void
Removes the named attribute from the current node.
Throws:
null |
DOMError |
---|
removeAttributeNS(namespace:String, localName:String):Void
Removes the attribute with the specified name and namespace, from the current node.
Throws:
null |
DOMError |
---|
removeAttributeNode(oldAttr:Attr):Attr
Removes the node representation of the named attribute from the current node.
Throws:
null |
DOMError |
---|
replaceWith(nodes:Rest<Node>):Void
replaceWith(nodes:Rest<String>):Void
Throws:
null |
DOMError |
---|
requestFullscreen():Void
Asynchronously asks the browser to make the element full-screen.
Throws:
null |
DOMError |
---|
requestPointerLock():Void
Allows to asynchronously ask for the pointer to be locked on the given element.
scroll(?options:Null<ScrollToOptions>):Void
scroll(x:Float, y:Float):Void
scrollBy(?options:Null<ScrollToOptions>):Void
scrollBy(x:Float, y:Float):Void
scrollIntoView(?arg:Bool):Void
scrollIntoView(?arg:Null<ScrollIntoViewOptions>):Void
Scrolls the page until the element gets into the view.
scrollTo(?options:Null<ScrollToOptions>):Void
scrollTo(x:Float, y:Float):Void
setAttribute(name:String, value:String):Void
Sets the value of a named attribute of the current node.
Throws:
null |
DOMError |
---|
setAttributeNS(namespace:String, name:String, value:String):Void
Sets the value of the attribute with the specified name and namespace, from the current node.
Throws:
null |
DOMError |
---|
setAttributeNode(newAttr:Attr):Attr
Sets the node representation of the named attribute from the current node.
Throws:
null |
DOMError |
---|
setAttributeNodeNS(newAttr:Attr):Attr
Sets the node representation of the attribute with the specified name and namespace, from the current node.
Throws:
null |
DOMError |
---|
setCapture(retargetToElement:Bool = false):Void
Sets up mouse event capture, redirecting all mouse events to this element.
setPointerCapture(pointerId:Int):Void
Designates a specific element as the capture target of future pointer events.
Throws:
null |
DOMError |
---|
toggleAttribute(name:String, ?force:Bool):Bool
Toggles a boolean attribute, removing it if it is present and adding it if it is not present, on the specified element.
Throws:
null |
DOMError |
---|
webkitMatchesSelector(selector:String):Bool
Throws:
null |
DOMError |
---|
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/DOMElement.html