Element class

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.

MDN Reference

Implemented types
Implementers
Available extensions
Annotations
  • @JS.new()
  • @staticInterop

Constructors

Element()
factory

Properties

addEventListener → ({void Function<K$>(ElementEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2
no setter
addEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
after ↔ void Function([Iterable?])

Available on ChildNode, provided by the ChildNode$Typings extension

getter/setter pair
animate ↔ Animation Function([dynamic, Object?])

Available on Animatable, provided by the Animatable$Typings extension

getter/setter pair
append ↔ void Function([Iterable?])

Available on ParentNode, provided by the ParentNode$Typings extension

getter/setter pair
appendChild ↔ T Function<T extends Node>(T)

Available on Node, provided by the Node$Typings extension

getter/setter pair
ariaAtomic ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaAutoComplete ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaBusy ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaChecked ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaColCount ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaColIndex ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaColSpan ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaCurrent ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaDisabled ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaExpanded ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaHasPopup ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaHidden ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaInvalid ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

getter/setter pair
ariaKeyShortcuts ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaLabel ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaLevel ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaLive ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaModal ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaMultiLine ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaMultiSelectable ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaOrientation ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaPlaceholder ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaPosInSet ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaPressed ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaReadOnly ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaRequired ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaRoleDescription ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaRowCount ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaRowIndex ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaRowSpan ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaSelected ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaSetSize ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaSort ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaValueMax ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaValueMin ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaValueNow ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
ariaValueText ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

MDN Reference
getter/setter pair
assignedSlot → HTMLSlotElement?

Available on Slottable, provided by the Slottable$Typings extension

MDN Reference
no setter
attachShadow ↔ ShadowRoot Function(ShadowRootInit)

Available on Element, provided by the Element$Typings extension

getter/setter pair
attributeNode → num

Available on Node, provided by the Node$Typings extension

no setter
attributes → NamedNodeMap

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
baseURI → String

Available on Node, provided by the Node$Typings extension

Returns node's node document's document base URL.
no setter
before ↔ void Function([Iterable?])

Available on ChildNode, provided by the ChildNode$Typings extension

getter/setter pair
cdataSectionNode → num

Available on Node, provided by the Node$Typings extension

node is a CDATASection node.
no setter
checkVisibility ↔ bool Function([CheckVisibilityOptions?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
childElementCount → num

Available on ParentNode, provided by the ParentNode$Typings extension

MDN Reference
no setter
childNodes → NodeListOf<ChildNode>

Available on Node, provided by the Node$Typings extension

Returns the children.
no setter
children → HTMLCollection

Available on ParentNode, provided by the ParentNode$Typings extension

Returns the child elements.
no setter
classList → DOMTokenList

Available on Element, provided by the Element$Typings extension

Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
no setter
className ↔ String

Available on Element, provided by the Element$Typings extension

Returns the value of element's class content attribute. Can be set to change it.
getter/setter pair
clientHeight → num

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
clientLeft → num

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
clientTop → num

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
clientWidth → num

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
cloneNode ↔ Node Function([bool?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
closest → ({K$? Function<K$ extends Element>(HTMLElementTagNameMap<K$> selectors) $1, E? Function<E extends Element>(String selectors) $2})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2
no setter
commentNode → num

Available on Node, provided by the Node$Typings extension

node is a Comment node.
no setter
compareDocumentPosition ↔ num Function(Node)

Available on Node, provided by the Node$Typings extension

getter/setter pair
computedStyleMap ↔ StylePropertyMapReadOnly Function()

Available on Element, provided by the Element$Typings extension

getter/setter pair
contains ↔ bool Function([Node?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
dispatchEvent ↔ bool Function(Event event)

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
documentFragmentNode → num

Available on Node, provided by the Node$Typings extension

node is a DocumentFragment node.
no setter
documentNode → num

Available on Node, provided by the Node$Typings extension

node is a document.
no setter
documentPositionContainedBy → num

Available on Node, provided by the Node$Typings extension

Set when other is a descendant of node.
no setter
documentPositionContains → num

Available on Node, provided by the Node$Typings extension

Set when other is an ancestor of node.
no setter
documentPositionDisconnected → num

Available on Node, provided by the Node$Typings extension

Set when node and other are not in the same tree.
no setter
documentPositionFollowing → num

Available on Node, provided by the Node$Typings extension

Set when other is following node.
no setter
documentPositionImplementationSpecific → num

Available on Node, provided by the Node$Typings extension

no setter
documentPositionPreceding → num

Available on Node, provided by the Node$Typings extension

Set when other is preceding node.
no setter
documentTypeNode → num

Available on Node, provided by the Node$Typings extension

node is a doctype.
no setter
elementNode → num

Available on Node, provided by the Node$Typings extension

node is an element.
no setter
entityNode → num

Available on Node, provided by the Node$Typings extension

no setter
entityReferenceNode → num

Available on Node, provided by the Node$Typings extension

no setter
firstChild → ChildNode?

Available on Node, provided by the Node$Typings extension

Returns the first child.
no setter
firstElementChild → Element?

Available on ParentNode, provided by the ParentNode$Typings extension

Returns the first child that is an element, and null otherwise.
no setter
getAnimations ↔ List<Animation> Function([GetAnimationsOptions?])

Available on Animatable, provided by the Animatable$Typings extension

getter/setter pair
getAttribute ↔ String? Function(String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
getAttributeNames ↔ List<String> Function()

Available on Element, provided by the Element$Typings extension

getter/setter pair
getAttributeNode ↔ Attr? Function(String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
getAttributeNodeNS ↔ Attr? Function(String, [String?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
getAttributeNS ↔ String? Function(String, [String?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
getBoundingClientRect ↔ DOMRect Function()

Available on Element, provided by the Element$Typings extension

getter/setter pair
getClientRects ↔ DOMRectList Function()

Available on Element, provided by the Element$Typings extension

getter/setter pair
getElementsByClassName ↔ HTMLCollectionOf<Element> Function(String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
getElementsByTagName → ({HTMLCollectionOf<K$> Function<K$ extends Element>(HTMLElementTagNameMap<K$> qualifiedName) $1, HTMLCollectionOf<Element> Function(String) $2})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2
no setter
getElementsByTagNameNS → ({HTMLCollectionOf<HTMLElement> Function(String namespaceURI, String localName) $1, HTMLCollectionOf<SVGElement> Function(String namespaceURI, String localName) $2, HTMLCollectionOf<MathMLElement> Function(String namespaceURI, String localName) $3, HTMLCollectionOf<Element> Function(String localName, [String? namespace]) $4})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2, $3, $4
no setter
getRootNode ↔ Node Function([GetRootNodeOptions?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
hasAttribute ↔ bool Function(String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
hasAttributeNS ↔ bool Function(String, [String?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
hasAttributes ↔ bool Function()

Available on Element, provided by the Element$Typings extension

getter/setter pair
hasChildNodes ↔ bool Function()

Available on Node, provided by the Node$Typings extension

getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hasPointerCapture ↔ bool Function(num)

Available on Element, provided by the Element$Typings extension

getter/setter pair
id ↔ String

Available on Element, provided by the Element$Typings extension

Returns the value of element's id content attribute. Can be set to change it.
getter/setter pair
innerHTML ↔ String

Available on InnerHTML, provided by the InnerHTML$Typings extension

MDN Reference
getter/setter pair
insertAdjacentElement ↔ Element? Function(InsertPosition, Element)

Available on Element, provided by the Element$Typings extension

getter/setter pair
insertAdjacentHTML ↔ void Function(InsertPosition, String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
insertAdjacentText ↔ void Function(InsertPosition, String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
insertBefore ↔ T Function<T extends Node>(T, [Node?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
isConnected → bool

Available on Node, provided by the Node$Typings extension

Returns true if node is connected and false otherwise.
no setter
isDefaultNamespace ↔ bool Function([String? message])

Available on Node, provided by the Node$Typings extension

getter/setter pair
isEqualNode ↔ bool Function([Node?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
isSameNode ↔ bool Function([Node?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
lastChild → ChildNode?

Available on Node, provided by the Node$Typings extension

Returns the last child.
no setter
lastElementChild → Element?

Available on ParentNode, provided by the ParentNode$Typings extension

Returns the last child that is an element, and null otherwise.
no setter
localName → String

Available on Element, provided by the Element$Typings extension

Returns the local name.
no setter
lookupNamespaceURI ↔ String? Function([String?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
lookupPrefix ↔ String? Function([String?])

Available on Node, provided by the Node$Typings extension

getter/setter pair
matches ↔ bool Function(String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
namespaceURI → String?

Available on Element, provided by the Element$Typings extension

Returns the namespace.
no setter
nextElementSibling → Element?

Available on NonDocumentTypeChildNode, provided by the NonDocumentTypeChildNode$Typings extension

Returns the first following sibling that is an element, and null otherwise.
no setter
nextSibling → ChildNode?

Available on Node, provided by the Node$Typings extension

Returns the next sibling.
no setter
nodeName → String

Available on Node, provided by the Node$Typings extension

Returns a string appropriate for the type of node.
no setter
nodeType → num

Available on Node, provided by the Node$Typings extension

Returns the type of node.
no setter
nodeValue ↔ String?

Available on Node, provided by the Node$Typings extension

MDN Reference
getter/setter pair
normalize ↔ void Function()

Available on Node, provided by the Node$Typings extension

getter/setter pair
notationNode → num

Available on Node, provided by the Node$Typings extension

no setter
onfullscreenchange ↔ dynamic Function(Event)?

Available on Element, provided by the Element$Typings extension

MDN Reference
getter/setter pair
onfullscreenerror ↔ dynamic Function(Event)?

Available on Element, provided by the Element$Typings extension

MDN Reference
getter/setter pair
outerHTML ↔ String

Available on Element, provided by the Element$Typings extension

MDN Reference
getter/setter pair
ownerDocument → Document?

Available on Node, provided by the Node$Typings extension

Returns the node document. Returns null for documents.
no setter
ownerDocument → Document

Available on Element, provided by the Element$Typings extension

Returns the node document. Returns null for documents.
no setter
parentElement → HTMLElement?

Available on Node, provided by the Node$Typings extension

Returns the parent element.
no setter
parentNode → ParentNode?

Available on Node, provided by the Node$Typings extension

Returns the parent.
no setter
part → DOMTokenList

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
prefix → String?

Available on Element, provided by the Element$Typings extension

Returns the namespace prefix.
no setter
prepend ↔ void Function([Iterable?])

Available on ParentNode, provided by the ParentNode$Typings extension

getter/setter pair
previousElementSibling → Element?

Available on NonDocumentTypeChildNode, provided by the NonDocumentTypeChildNode$Typings extension

Returns the first preceding sibling that is an element, and null otherwise.
no setter
previousSibling → ChildNode?

Available on Node, provided by the Node$Typings extension

Returns the previous sibling.
no setter
processingInstructionNode → num

Available on Node, provided by the Node$Typings extension

node is a ProcessingInstruction node.
no setter
querySelector → ({K$? Function<K$ extends Element>(HTMLElementTagNameMap<K$> selectors) $1, E? Function<E extends Element>(String selectors) $2})

Available on ParentNode, provided by the ParentNode$Typings extension

Overload accessor: $1, $2
no setter
querySelectorAll → ({NodeListOf<K$> Function<K$ extends Element>(HTMLElementTagNameMap<K$> selectors) $1, NodeListOf<E> Function<E extends Element>(String selectors) $2})

Available on ParentNode, provided by the ParentNode$Typings extension

Overload accessor: $1, $2
no setter
releasePointerCapture ↔ void Function(num handle)

Available on Element, provided by the Element$Typings extension

getter/setter pair
remove ↔ void Function()

Available on ChildNode, provided by the ChildNode$Typings extension

getter/setter pair
removeAttribute ↔ void Function(String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
removeAttributeNode ↔ Attr Function(Attr)

Available on Element, provided by the Element$Typings extension

getter/setter pair
removeAttributeNS ↔ void Function(String, [String?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
removeChild ↔ T Function<T extends Node>(T)

Available on Node, provided by the Node$Typings extension

getter/setter pair
removeEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
removeEventListener → ({void Function<K$>(ElementEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2
no setter
replaceChild ↔ T Function<T extends Node>(Node, T)

Available on Node, provided by the Node$Typings extension

getter/setter pair
replaceChildren ↔ void Function([Iterable?])

Available on ParentNode, provided by the ParentNode$Typings extension

getter/setter pair
replaceWith ↔ void Function([Iterable?])

Available on ChildNode, provided by the ChildNode$Typings extension

getter/setter pair
requestFullscreen ↔ Future<void> Function([FullscreenOptions?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
requestPointerLock ↔ void Function()

Available on Element, provided by the Element$Typings extension

getter/setter pair
role ↔ String?

Available on ARIAMixin, provided by the ARIAMixin$Typings extension

getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scroll → ({void Function([ScrollToOptions? options]) $1, void Function(num x, num y) $2})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2
no setter
scrollBy → ({void Function([ScrollToOptions? options]) $1, void Function(num x, num y) $2})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2
no setter
scrollHeight → num

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
scrollIntoView ↔ void Function([Object?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
scrollLeft ↔ num

Available on Element, provided by the Element$Typings extension

MDN Reference
getter/setter pair
scrollTo → ({void Function([ScrollToOptions? options]) $1, void Function(num x, num y) $2})

Available on Element, provided by the Element$Typings extension

Overload accessor: $1, $2
no setter
scrollTop ↔ num

Available on Element, provided by the Element$Typings extension

MDN Reference
getter/setter pair
scrollWidth → num

Available on Element, provided by the Element$Typings extension

MDN Reference
no setter
setAttribute ↔ void Function(String, String)

Available on Element, provided by the Element$Typings extension

getter/setter pair
setAttributeNode ↔ Attr? Function(Attr)

Available on Element, provided by the Element$Typings extension

getter/setter pair
setAttributeNodeNS ↔ Attr? Function(Attr)

Available on Element, provided by the Element$Typings extension

getter/setter pair
setAttributeNS ↔ void Function(String, String, [String?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
setPointerCapture ↔ void Function(num handle)

Available on Element, provided by the Element$Typings extension

getter/setter pair
shadowRoot → ShadowRoot?

Available on Element, provided by the Element$Typings extension

Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.
no setter
slot ↔ String

Available on Element, provided by the Element$Typings extension

Returns the value of element's slot content attribute. Can be set to change it.
getter/setter pair
tagName → String

Available on Element, provided by the Element$Typings extension

Returns the HTML-uppercased qualified name.
no setter
textContent ↔ String?

Available on Node, provided by the Node$Typings extension

MDN Reference
getter/setter pair
textNode → num

Available on Node, provided by the Node$Typings extension

node is a Text node.
no setter
toggleAttribute ↔ bool Function(String, [bool?])

Available on Element, provided by the Element$Typings extension

getter/setter pair
webkitMatchesSelector ↔ bool Function(String)

Available on Element, provided by the Element$Typings extension

getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited