Element class - dart:html library (original) (raw)
An abstract class, which all HTML elements extend.
Inheritance
- Object
- EventTarget
- Node
- Element
Implemented types
Implementers
Annotations
- @Native("Element")
Constructors
Creates a new <a>
element.
factory
Creates a new <article>
element.
factory
Creates a new <aside>
element.
factory
Creates a new <audio>
element.
factory
Creates a new <br>
element.
factory
Creates a new <canvas>
element.
factory
Custom element creation constructor.
Creates a new <div>
element.
factory
Creates a new <footer>
element.
factory
Creates a new <header>
element.
factory
Creates a new <hr>
element.
factory
Element.html(String? html, {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer})
Creates an HTML element from a valid fragment of HTML.
factory
Creates a new <iframe>
element.
factory
Creates a new <img>
element.
factory
Creates a new <li>
element.
factory
Creates a new <nav>
element.
factory
Creates a new <ol>
element.
factory
Creates a new <option>
element.
factory
Creates a new <p>
element.
factory
Creates a new <pre>
element.
factory
Creates a new <section>
element.
factory
Creates a new <select>
element.
factory
Creates a new <span>
element.
factory
Creates a new <svg>
element.
factory
Creates a new <table>
element.
factory
Element.tag(String tag, [String? typeExtension])
Creates the HTML element specified by the tag name.
factory
Creates a new <td>
element.
factory
Creates a new <textarea>
element.
factory
Creates a new <th>
element.
factory
Creates a new <tr>
element.
factory
Creates a new <ul>
element.
factory
Creates a new <video>
element.
factory
Properties
accessibleNode → AccessibleNode?
no setter
no setter
attributes ↔ Map<String, String>
All attributes on this element.
getter/setter pair
no setterinherited
Access the dimensions and position of this element's content + padding + border box.
no setter
childNodes → List<Node>
A list of this node's children.
no setterinherited
List of the direct children of this element.
getter/setter pair
The set of CSS classes applied to this element.
getter/setter pair
getter/setter pair
Gets the position of this element relative to the client area of the page.
no setter
no setter
clientLeft → int?
no setter
no setter
no setter
no setter
no setter
Access this element's content position.
no setter
getter/setter pair
Allows access to all custom data attributes (data-*) set on this element.
getter/setter pair
getter/setter pair
Provides the coordinates of the element relative to the top of the document.
no setter
Indicates whether the element can be dragged and dropped.
getter/setter pair
firstChild → Node?
The first child of this node.
no setterinherited
The hash code for this object.
no setterinherited
Indicates whether the element is not relevant to the page's current state.
getter/setter pair
getter/setter pair
getter/setter pair
Parses the HTML fragment and sets it as the contents of this element.
getter/setter pair
getter/setter pair
getter/setter pair
isConnected → bool?
no setterinherited
no setter
getter/setter pair
The last child of this node.
no setterinherited
no setter
Access the dimensions and position of this element's content + padding + border + margin box.
no setter
A URI that identifies the XML namespace of this element.
no setter
no setteroverride
The next sibling node.
no setterinherited
The name of this node.
no setterinherited
A modifiable list of this node's children.
getter/setter pairinherited
The type of node.
no setterinherited
The value of this node.
no setterinherited
Gets the offset of this element relative to its offsetParent.
no setter
no setter
no setter
no setter
no setter
no setter
This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.
no setteroverride
onAbort → ElementStream<Event>
Stream of abort
events handled by this Element.
no setteroverride
onBeforeCopy → ElementStream<Event>
Stream of beforecopy
events handled by this Element.
no setter
onBeforeCut → ElementStream<Event>
Stream of beforecut
events handled by this Element.
no setter
onBeforePaste → ElementStream<Event>
Stream of beforepaste
events handled by this Element.
no setter
Stream of blur
events handled by this Element.
no setteroverride
onCanPlay → ElementStream<Event>
no setteroverride
onCanPlayThrough → ElementStream<Event>
no setteroverride
onChange → ElementStream<Event>
Stream of change
events handled by this Element.
no setteroverride
onClick → ElementStream<MouseEvent>
Stream of click
events handled by this Element.
no setteroverride
Stream of contextmenu
events handled by this Element.
no setteroverride
onCopy → ElementStream<ClipboardEvent>
Stream of copy
events handled by this Element.
no setter
onCut → ElementStream<ClipboardEvent>
Stream of cut
events handled by this Element.
no setter
onDoubleClick → ElementStream<Event>
Stream of doubleclick
events handled by this Element.
no setteroverride
onDrag → ElementStream<MouseEvent>
A stream of drag
events fired when this element currently being dragged.
no setteroverride
onDragEnd → ElementStream<MouseEvent>
A stream of dragend
events fired when this element completes a drag operation.
no setteroverride
onDragEnter → ElementStream<MouseEvent>
A stream of dragenter
events fired when a dragged object is first dragged over this element.
no setteroverride
onDragLeave → ElementStream<MouseEvent>
A stream of dragleave
events fired when an object being dragged over this element leaves this element's target area.
no setteroverride
onDragOver → ElementStream<MouseEvent>
A stream of dragover
events fired when a dragged object is currently being dragged over this element.
no setteroverride
onDragStart → ElementStream<MouseEvent>
A stream of dragstart
events fired when this element starts being dragged.
no setteroverride
onDrop → ElementStream<MouseEvent>
A stream of drop
events fired when a dragged object is dropped on this element.
no setteroverride
onDurationChange → ElementStream<Event>
no setteroverride
onEmptied → ElementStream<Event>
no setteroverride
onEnded → ElementStream<Event>
no setteroverride
onError → ElementStream<Event>
Stream of error
events handled by this Element.
no setteroverride
onFocus → ElementStream<Event>
Stream of focus
events handled by this Element.
no setteroverride
onFullscreenChange → ElementStream<Event>
Stream of fullscreenchange
events handled by this Element.
no setter
onFullscreenError → ElementStream<Event>
Stream of fullscreenerror
events handled by this Element.
no setter
onInput → ElementStream<Event>
Stream of input
events handled by this Element.
no setteroverride
onInvalid → ElementStream<Event>
Stream of invalid
events handled by this Element.
no setteroverride
onKeyDown → ElementStream<KeyboardEvent>
Stream of keydown
events handled by this Element.
no setteroverride
onKeyPress → ElementStream<KeyboardEvent>
Stream of keypress
events handled by this Element.
no setteroverride
onKeyUp → ElementStream<KeyboardEvent>
Stream of keyup
events handled by this Element.
no setteroverride
Stream of load
events handled by this Element.
no setteroverride
onLoadedData → ElementStream<Event>
no setteroverride
onLoadedMetadata → ElementStream<Event>
no setteroverride
onMouseDown → ElementStream<MouseEvent>
Stream of mousedown
events handled by this Element.
no setteroverride
onMouseEnter → ElementStream<MouseEvent>
Stream of mouseenter
events handled by this Element.
no setteroverride
onMouseLeave → ElementStream<MouseEvent>
Stream of mouseleave
events handled by this Element.
no setteroverride
onMouseMove → ElementStream<MouseEvent>
Stream of mousemove
events handled by this Element.
no setteroverride
onMouseOut → ElementStream<MouseEvent>
Stream of mouseout
events handled by this Element.
no setteroverride
onMouseOver → ElementStream<MouseEvent>
Stream of mouseover
events handled by this Element.
no setteroverride
onMouseUp → ElementStream<MouseEvent>
Stream of mouseup
events handled by this Element.
no setteroverride
onMouseWheel → ElementStream<WheelEvent>
Stream of mousewheel
events handled by this Element.
no setteroverride
onPaste → ElementStream<ClipboardEvent>
Stream of paste
events handled by this Element.
no setter
onPause → ElementStream<Event>
no setteroverride
no setteroverride
onPlaying → ElementStream<Event>
no setteroverride
onRateChange → ElementStream<Event>
no setteroverride
onReset → ElementStream<Event>
Stream of reset
events handled by this Element.
no setteroverride
onResize → ElementStream<Event>
no setteroverride
onScroll → ElementStream<Event>
Stream of scroll
events handled by this Element.
no setteroverride
onSearch → ElementStream<Event>
Stream of search
events handled by this Element.
no setter
onSeeked → ElementStream<Event>
no setteroverride
onSeeking → ElementStream<Event>
no setteroverride
onSelect → ElementStream<Event>
Stream of select
events handled by this Element.
no setteroverride
onSelectStart → ElementStream<Event>
Stream of selectstart
events handled by this Element.
no setter
onStalled → ElementStream<Event>
no setteroverride
onSubmit → ElementStream<Event>
Stream of submit
events handled by this Element.
no setteroverride
onSuspend → ElementStream<Event>
no setteroverride
onTimeUpdate → ElementStream<Event>
no setteroverride
onTouchCancel → ElementStream<TouchEvent>
Stream of touchcancel
events handled by this Element.
no setteroverride
onTouchEnd → ElementStream<TouchEvent>
Stream of touchend
events handled by this Element.
no setteroverride
onTouchEnter → ElementStream<TouchEvent>
Stream of touchenter
events handled by this Element.
no setter
onTouchLeave → ElementStream<TouchEvent>
Stream of touchleave
events handled by this Element.
no setter
onTouchMove → ElementStream<TouchEvent>
Stream of touchmove
events handled by this Element.
no setteroverride
onTouchStart → ElementStream<TouchEvent>
Stream of touchstart
events handled by this Element.
no setteroverride
onTransitionEnd → ElementStream<TransitionEvent>
Stream of transitionend
events handled by this Element.
no setter
onVolumeChange → ElementStream<Event>
no setteroverride
onWaiting → ElementStream<Event>
no setteroverride
onWheel → ElementStream<WheelEvent>
no setteroverride
no setter
The document this node belongs to.
no setterinherited
Access the dimensions and position of this element's content + padding box.
no setter
The parent element of this node.
no setterinherited
parentNode → Node?
The parent node of this node.
no setterinherited
previousElementSibling → Element?
no setteroverride
previousNode → Node?
The previous sibling node.
no setterinherited
A representation of the runtime type of the object.
no setterinherited
no setter
getter/setter pair
getter/setter pair
no setter
The shadow root of this shadow host.
no setter
getter/setter pair
spellcheck ↔ bool?
getter/setter pair
no setter
no setter
getter/setter pair
no setter
All text within this node and its descendants.
getter/setter pairinherited
getter/setter pair
Specifies whether this element's text content changes when the page is localized.
getter/setter pair
Methods
addEventListener(String type, EventListener? listener, [bool? useCapture])→ void
inherited
override
animate(Iterable<Map<String, dynamic>> frames, [dynamic timing])→ Animation
Creates a new AnimationEffect object whose target element is the object on which the method is called, and calls the play() method of the AnimationTimeline object of the document timeline of the node document of the element, passing the newly created AnimationEffect as the argument to the method. Returns an Animation for the effect.
Adds a node to the end of the child nodes list of this node.
inherited
appendHtml(String text, {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer})→ void
Parses the specified text as HTML and adds the resulting node after the last child of this element.
appendText(String text)→ void
Adds the specified text after the last child of this element.
attached()→ void
Called by the DOM when this element has been inserted into the live document.
attachShadow(Map shadowRootInitDict)→ ShadowRoot
attributeChanged(String name, String oldValue, String newValue)→ void
Called by the DOM whenever an attribute on this has been changed.
override
blur()→ void
click()→ void
Returns a copy of this node.
inherited
closest(String selectors)→ Element?
Returns true if this node contains the specified node.
inherited
createFragment(String? html, {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer})→ DocumentFragment
Create a DocumentFragment from the HTML fragment and ensure that it follows the sanitization rules specified by the validator or treeSanitizer.
createShadowRoot()→ ShadowRoot
Creates a new shadow root for this shadow host.
detached()→ void
Called by the DOM when this element has been removed from the live document.
dispatchEvent(Event event)→ bool
inherited
enteredView()→ void
Deprecated*: override attached instead.
focus()→ void
getAnimations()→ List<Animation>
getAttribute(String name)→ String?
getAttributeNames()→ List<String>
getAttributeNS(String? namespaceURI, String name)→ String?
getBoundingClientRect()→ Rectangle<num>
Returns the smallest bounding rectangle that encompasses this element's padding, scrollbar, and border.
getClientRects()→ List<Rectangle<num>>
getComputedStyle([String? pseudoElement])→ CssStyleDeclaration
The set of all CSS values applied to this element, including inherited and default values.
getDestinationInsertionPoints()→ List<Node>
Returns a list of shadow DOM insertion points to which this element is distributed.
getElementsByClassName(String classNames)→ List<Node>
Returns a list of nodes with the given class name inside this element.
getNamespacedAttributes(String namespace)→ Map<String, String>
Gets a map for manipulating the attributes of a particular namespace.
getRootNode([Map? options])→ Node
inherited
hasAttribute(String name)→ bool
hasAttributeNS(String? namespaceURI, String name)→ bool
Returns true if this node has any children.
inherited
hasPointerCapture(int pointerId)→ bool
insertAdjacentElement(String where, Element element)→ Element
Inserts element
into the DOM at the specified location.
insertAdjacentHtml(String where, String html, {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer})→ void
Parses text as an HTML fragment and inserts it into the DOM at the specified location.
insertAdjacentText(String where, String text)→ void
Inserts text into the DOM at the specified location.
insertAllBefore(Iterable<Node> newNodes, Node child)→ void
Inserts all of the nodes into this node directly before child.
inherited
insertBefore(Node node, Node? child)→ Node
Inserts the given node into this node directly before child. If child is null
, then the given node is inserted at the end of this node's child nodes.
inherited
leftView()→ void
Deprecated*: override detached instead.
matches(String selectors)→ bool
Checks if this element matches the CSS selectors.
matchesWithAncestors(String selectors)→ bool
Checks if this element or any of its parents match the CSS selectors.
noSuchMethod(Invocation invocation)→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offsetTo(Element parent)→ Point<num>
Provides the offset of this element's borderEdge relative to the specified parent
.
querySelector(String selectors)→ Element?
Finds the first descendant element of this element that matches the specified group of selectors.
override
querySelectorAll<T extends Element>(String selectors)→ ElementList<T>
Finds all descendent elements of this element that match the specified group of selectors.
releasePointerCapture(int pointerId)→ void
remove()→ void
Removes this node from the DOM.
inherited
removeAttribute(String name)→ void
removeAttributeNS(String? namespaceURI, String name)→ void
removeEventListener(String type, EventListener? listener, [bool? useCapture])→ void
inherited
replaceWith(Node otherNode)→ Node
Replaces this node with another node.
inherited
requestFullscreen([Map? options])→ Future<void>
Displays this element fullscreen.
requestPointerLock()→ void
scroll([dynamic options_OR_x, num? y])→ void
scrollBy([dynamic options_OR_x, num? y])→ void
scrollIntoView([ScrollAlignment? alignment])→ void
Scrolls this element into view.
scrollIntoViewIfNeeded([bool? centerIfNeeded])→ void
Nonstandard version of scrollIntoView
that scrolls the current element into the visible area of the browser window if it's not already within the visible area of the browser window. If the element is already within the visible area of the browser window, then no scrolling takes place.
scrollTo([dynamic options_OR_x, num? y])→ void
setApplyScroll(String nativeScrollBehavior)→ Future<ScrollState>
setAttribute(String name, Object value)→ void
setAttributeNS(String? namespaceURI, String name, Object value)→ void
setDistributeScroll(String nativeScrollBehavior)→ Future<ScrollState>
setInnerHtml(String? html, {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer})→ void
Parses the HTML fragment and sets it as the contents of this element. This ensures that the generated content follows the sanitization rules specified by the validator or treeSanitizer.
setPointerCapture(int pointerId)→ void
The string representation of this element.
override
Operators
operator ==(Object other)→ bool
The equality operator.
inherited
Static Methods
isTagSupported(String tag)→ bool
Checks to see if the tag name is supported by the current platform.
Constants
abortEvent → const EventStreamProvider<Event>
Static factory designed to expose abort
events to event handlers that are not necessarily instances of Element.
beforeCopyEvent → const EventStreamProvider<Event>
Static factory designed to expose beforecopy
events to event handlers that are not necessarily instances of Element.
beforeCutEvent → const EventStreamProvider<Event>
Static factory designed to expose beforecut
events to event handlers that are not necessarily instances of Element.
beforePasteEvent → const EventStreamProvider<Event>
Static factory designed to expose beforepaste
events to event handlers that are not necessarily instances of Element.
blurEvent → const EventStreamProvider<Event>
Static factory designed to expose blur
events to event handlers that are not necessarily instances of Element.
canPlayEvent → const EventStreamProvider<Event>
canPlayThroughEvent → const EventStreamProvider<Event>
changeEvent → const EventStreamProvider<Event>
Static factory designed to expose change
events to event handlers that are not necessarily instances of Element.
clickEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose click
events to event handlers that are not necessarily instances of Element.
Static factory designed to expose contextmenu
events to event handlers that are not necessarily instances of Element.
copyEvent → const EventStreamProvider<ClipboardEvent>
Static factory designed to expose copy
events to event handlers that are not necessarily instances of Element.
cutEvent → const EventStreamProvider<ClipboardEvent>
Static factory designed to expose cut
events to event handlers that are not necessarily instances of Element.
doubleClickEvent → const EventStreamProvider<Event>
Static factory designed to expose doubleclick
events to event handlers that are not necessarily instances of Element.
dragEndEvent → const EventStreamProvider<MouseEvent>
A stream of dragend
events fired when an element completes a drag operation.
dragEnterEvent → const EventStreamProvider<MouseEvent>
A stream of dragenter
events fired when a dragged object is first dragged over an element.
dragEvent → const EventStreamProvider<MouseEvent>
A stream of drag
events fired when an element is currently being dragged.
dragLeaveEvent → const EventStreamProvider<MouseEvent>
A stream of dragleave
events fired when an object being dragged over an element leaves the element's target area.
dragOverEvent → const EventStreamProvider<MouseEvent>
A stream of dragover
events fired when a dragged object is currently being dragged over an element.
dragStartEvent → const EventStreamProvider<MouseEvent>
A stream of dragstart
events for a dragged element whose drag has begun.
dropEvent → const EventStreamProvider<MouseEvent>
A stream of drop
events fired when a dragged object is dropped on an element.
durationChangeEvent → const EventStreamProvider<Event>
emptiedEvent → const EventStreamProvider<Event>
endedEvent → const EventStreamProvider<Event>
errorEvent → const EventStreamProvider<Event>
Static factory designed to expose error
events to event handlers that are not necessarily instances of Element.
focusEvent → const EventStreamProvider<Event>
Static factory designed to expose focus
events to event handlers that are not necessarily instances of Element.
fullscreenChangeEvent → const EventStreamProvider<Event>
Static factory designed to expose fullscreenchange
events to event handlers that are not necessarily instances of Element.
fullscreenErrorEvent → const EventStreamProvider<Event>
Static factory designed to expose fullscreenerror
events to event handlers that are not necessarily instances of Element.
inputEvent → const EventStreamProvider<Event>
Static factory designed to expose input
events to event handlers that are not necessarily instances of Element.
invalidEvent → const EventStreamProvider<Event>
Static factory designed to expose invalid
events to event handlers that are not necessarily instances of Element.
keyDownEvent → const EventStreamProvider<KeyboardEvent>
Static factory designed to expose keydown
events to event handlers that are not necessarily instances of Element.
keyPressEvent → const EventStreamProvider<KeyboardEvent>
Static factory designed to expose keypress
events to event handlers that are not necessarily instances of Element.
keyUpEvent → const EventStreamProvider<KeyboardEvent>
Static factory designed to expose keyup
events to event handlers that are not necessarily instances of Element.
loadedDataEvent → const EventStreamProvider<Event>
loadedMetadataEvent → const EventStreamProvider<Event>
loadEvent → const EventStreamProvider<Event>
Static factory designed to expose load
events to event handlers that are not necessarily instances of Element.
mouseDownEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose mousedown
events to event handlers that are not necessarily instances of Element.
mouseEnterEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose mouseenter
events to event handlers that are not necessarily instances of Element.
mouseLeaveEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose mouseleave
events to event handlers that are not necessarily instances of Element.
mouseMoveEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose mousemove
events to event handlers that are not necessarily instances of Element.
mouseOutEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose mouseout
events to event handlers that are not necessarily instances of Element.
mouseOverEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose mouseover
events to event handlers that are not necessarily instances of Element.
mouseUpEvent → const EventStreamProvider<MouseEvent>
Static factory designed to expose mouseup
events to event handlers that are not necessarily instances of Element.
mouseWheelEvent → const EventStreamProvider<WheelEvent>
Static factory designed to expose mousewheel
events to event handlers that are not necessarily instances of Element.
pasteEvent → const EventStreamProvider<ClipboardEvent>
Static factory designed to expose paste
events to event handlers that are not necessarily instances of Element.
pauseEvent → const EventStreamProvider<Event>
playEvent → const EventStreamProvider<Event>
playingEvent → const EventStreamProvider<Event>
rateChangeEvent → const EventStreamProvider<Event>
resetEvent → const EventStreamProvider<Event>
Static factory designed to expose reset
events to event handlers that are not necessarily instances of Element.
resizeEvent → const EventStreamProvider<Event>
scrollEvent → const EventStreamProvider<Event>
Static factory designed to expose scroll
events to event handlers that are not necessarily instances of Element.
searchEvent → const EventStreamProvider<Event>
Static factory designed to expose search
events to event handlers that are not necessarily instances of Element.
seekedEvent → const EventStreamProvider<Event>
seekingEvent → const EventStreamProvider<Event>
selectEvent → const EventStreamProvider<Event>
Static factory designed to expose select
events to event handlers that are not necessarily instances of Element.
selectStartEvent → const EventStreamProvider<Event>
Static factory designed to expose selectstart
events to event handlers that are not necessarily instances of Element.
stalledEvent → const EventStreamProvider<Event>
submitEvent → const EventStreamProvider<Event>
Static factory designed to expose submit
events to event handlers that are not necessarily instances of Element.
suspendEvent → const EventStreamProvider<Event>
timeUpdateEvent → const EventStreamProvider<Event>
touchCancelEvent → const EventStreamProvider<TouchEvent>
Static factory designed to expose touchcancel
events to event handlers that are not necessarily instances of Element.
touchEndEvent → const EventStreamProvider<TouchEvent>
Static factory designed to expose touchend
events to event handlers that are not necessarily instances of Element.
touchEnterEvent → const EventStreamProvider<TouchEvent>
Static factory designed to expose touchenter
events to event handlers that are not necessarily instances of Element.
touchLeaveEvent → const EventStreamProvider<TouchEvent>
Static factory designed to expose touchleave
events to event handlers that are not necessarily instances of Element.
touchMoveEvent → const EventStreamProvider<TouchEvent>
Static factory designed to expose touchmove
events to event handlers that are not necessarily instances of Element.
touchStartEvent → const EventStreamProvider<TouchEvent>
Static factory designed to expose touchstart
events to event handlers that are not necessarily instances of Element.
transitionEndEvent → const EventStreamProvider<TransitionEvent>
Static factory designed to expose transitionend
events to event handlers that are not necessarily instances of Element.
volumeChangeEvent → const EventStreamProvider<Event>
waitingEvent → const EventStreamProvider<Event>
wheelEvent → const EventStreamProvider<WheelEvent>