Skip to content

Element ​

Annotations: @Native.new("Element")

An abstract class, which all HTML elements extend.

Inheritance

Object → EventTarget → Node → Element

Constructors ​

Element.a() factory ​

factory Element.a()

Creates a new <a> element.

This is equivalent to calling new Element.tag('a').

Implementation
dart
factory Element.a() => new AnchorElement();

Element.article() factory ​

factory Element.article()

Creates a new <article> element.

This is equivalent to calling new Element.tag('article').

Implementation
dart
factory Element.article() => new Element.tag('article');

Element.aside() factory ​

factory Element.aside()

Creates a new <aside> element.

This is equivalent to calling new Element.tag('aside').

Implementation
dart
factory Element.aside() => new Element.tag('aside');

Element.audio() factory ​

factory Element.audio()

Creates a new <audio> element.

This is equivalent to calling new Element.tag('audio').

Implementation
dart
factory Element.audio() => new Element.tag('audio');

Element.br() factory ​

factory Element.br()

Creates a new <br> element.

This is equivalent to calling new Element.tag('br').

Implementation
dart
factory Element.br() => new BRElement();

Element.canvas() factory ​

factory Element.canvas()

Creates a new <canvas> element.

This is equivalent to calling new Element.tag('canvas').

Implementation
dart
factory Element.canvas() => new CanvasElement();

Element.div() factory ​

factory Element.div()

Creates a new <div> element.

This is equivalent to calling new Element.tag('div').

Implementation
dart
factory Element.div() => new DivElement();
factory Element.footer()

Creates a new <footer> element.

This is equivalent to calling new Element.tag('footer').

Implementation
dart
factory Element.footer() => new Element.tag('footer');
factory Element.header()

Creates a new <header> element.

This is equivalent to calling new Element.tag('header').

Implementation
dart
factory Element.header() => new Element.tag('header');

Element.hr() factory ​

factory Element.hr()

Creates a new <hr> element.

This is equivalent to calling new Element.tag('hr').

Implementation
dart
factory Element.hr() => new Element.tag('hr');

Element.html() factory ​

factory Element.html(
  String? html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
})

Creates an HTML element from a valid fragment of HTML.

dart
var element = new Element.html('<div class="foo">content</div>');

The HTML fragment should contain only one single root element, any leading or trailing text nodes will be removed.

The HTML fragment is parsed as if it occurred within the context of a <body> tag, this means that special elements such as <caption> which must be parsed within the scope of a <table> element will be dropped. Use createFragment to parse contextual HTML fragments.

Unless a validator is provided this will perform the default validation and remove all scriptable elements and attributes.

See also:

Implementation
dart
factory Element.html(
  String? html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
}) {
  var fragment = document.body!.createFragment(
    html,
    validator: validator,
    treeSanitizer: treeSanitizer,
  );

  return fragment.nodes.where((e) => e is Element).single as Element;
}

Element.iframe() factory ​

factory Element.iframe()

Creates a new <iframe> element.

This is equivalent to calling new Element.tag('iframe').

Implementation
dart
factory Element.iframe() => new Element.tag('iframe');

Element.img() factory ​

factory Element.img()

Creates a new <img> element.

This is equivalent to calling new Element.tag('img').

Implementation
dart
factory Element.img() => new Element.tag('img');

Element.li() factory ​

factory Element.li()

Creates a new <li> element.

This is equivalent to calling new Element.tag('li').

Implementation
dart
factory Element.li() => new Element.tag('li');
factory Element.nav()

Creates a new <nav> element.

This is equivalent to calling new Element.tag('nav').

Implementation
dart
factory Element.nav() => new Element.tag('nav');

Element.ol() factory ​

factory Element.ol()

Creates a new <ol> element.

This is equivalent to calling new Element.tag('ol').

Implementation
dart
factory Element.ol() => new Element.tag('ol');

Element.option() factory ​

factory Element.option()

Creates a new <option> element.

This is equivalent to calling new Element.tag('option').

Implementation
dart
factory Element.option() => new Element.tag('option');

Element.p() factory ​

factory Element.p()

Creates a new <p> element.

This is equivalent to calling new Element.tag('p').

Implementation
dart
factory Element.p() => new Element.tag('p');

Element.pre() factory ​

factory Element.pre()

Creates a new <pre> element.

This is equivalent to calling new Element.tag('pre').

Implementation
dart
factory Element.pre() => new Element.tag('pre');

Element.section() factory ​

factory Element.section()

Creates a new <section> element.

This is equivalent to calling new Element.tag('section').

Implementation
dart
factory Element.section() => new Element.tag('section');

Element.select() factory ​

factory Element.select()

Creates a new <select> element.

This is equivalent to calling new Element.tag('select').

Implementation
dart
factory Element.select() => new Element.tag('select');

Element.span() factory ​

factory Element.span()

Creates a new <span> element.

This is equivalent to calling new Element.tag('span').

Implementation
dart
factory Element.span() => new Element.tag('span');

Element.svg() factory ​

factory Element.svg()

Creates a new <svg> element.

This is equivalent to calling new Element.tag('svg').

Implementation
dart
factory Element.svg() => new Element.tag('svg');

Element.table() factory ​

factory Element.table()

Creates a new <table> element.

This is equivalent to calling new Element.tag('table').

Implementation
dart
factory Element.table() => new Element.tag('table');

Element.tag() factory ​

factory Element.tag(String tag, [String? typeExtension])

Creates the HTML element specified by the tag name.

This is similar to Document.createElement. tag should be a valid HTML tag name. If tag is an unknown tag then this will create an UnknownElement.

dart
var divElement = new Element.tag('div');
print(divElement is DivElement); // 'true'
var myElement = new Element.tag('unknownTag');
print(myElement is UnknownElement); // 'true'

For standard elements it is better to use the element type constructors:

dart
var element = new DivElement();

It is better to use e.g new CanvasElement() because the type of the expression is CanvasElement, whereas the type of Element.tag is the less specific Element.

See also:

Implementation
dart
factory Element.tag(String tag, [String? typeExtension]) =>
    _ElementFactoryProvider.createElement_tag(tag, typeExtension);

Element.td() factory ​

factory Element.td()

Creates a new <td> element.

This is equivalent to calling new Element.tag('td').

Implementation
dart
factory Element.td() => new Element.tag('td');

Element.textarea() factory ​

factory Element.textarea()

Creates a new <textarea> element.

This is equivalent to calling new Element.tag('textarea').

Implementation
dart
factory Element.textarea() => new Element.tag('textarea');

Element.th() factory ​

factory Element.th()

Creates a new <th> element.

This is equivalent to calling new Element.tag('th').

Implementation
dart
factory Element.th() => new Element.tag('th');

Element.tr() factory ​

factory Element.tr()

Creates a new <tr> element.

This is equivalent to calling new Element.tag('tr').

Implementation
dart
factory Element.tr() => new Element.tag('tr');

Element.ul() factory ​

factory Element.ul()

Creates a new <ul> element.

This is equivalent to calling new Element.tag('ul').

Implementation
dart
factory Element.ul() => new Element.tag('ul');

Element.video() factory ​

factory Element.video()

Creates a new <video> element.

This is equivalent to calling new Element.tag('video').

Implementation
dart
factory Element.video() => new Element.tag('video');

Properties ​

accessibleNode no setter ​

AccessibleNode? get accessibleNode
Implementation
dart
AccessibleNode? get accessibleNode native;

assignedSlot no setter ​

SlotElement? get assignedSlot
Implementation
dart
SlotElement? get assignedSlot native;

attributes read / write ​

Map<String, String> get attributes

All attributes on this element.

Any modifications to the attribute map will automatically be applied to this element.

This only includes attributes which are not in a namespace (such as 'xlink:href'), additional attributes can be accessed via getNamespacedAttributes.

Implementation
dart
Map<String, String> get attributes => new _ElementAttributeMap(this);

set attributes(Map<String, String> value) {
  Map<String, String> attributes = this.attributes;
  attributes.clear();
  for (String key in value.keys) {
    attributes[key] = value[key]!;
  }
}

baseUri no setter inherited ​

String? get baseUri

Inherited from Node.

Implementation
dart
@JSName('baseURI')
String? get baseUri native;

borderEdge no setter ​

CssRect get borderEdge

Access the dimensions and position of this element's content + padding + border box.

This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not. This can be used to retrieve jQuery's outerHeight value for an element.

Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow

Implementation
dart
CssRect get borderEdge => new _BorderCssRect(this);

childNodes no setter inherited ​

List<Node> get childNodes

A list of this node's children.

Other resources ​

Inherited from Node.

Implementation
dart
@Returns('NodeList')
@Creates('NodeList')
List<Node> get childNodes native;

children read / write ​

List<Element> get children

List of the direct children of this element.

This collection can be used to add and remove elements from the document.

dart
var item = new DivElement();
item.text = 'Something';
document.body.children.add(item) // Item is now displayed on the page.
for (var element in document.body.children) {
  element.style.background = 'red'; // Turns every child of body red.
}
Implementation
dart
List<Element> get children => new _ChildrenElementList._wrap(this);

set children(List<Element> value) {
  &#47;&#47; Copy list first since we don't want liveness during iteration.
  var copy = value.toList();
  var children = this.children;
  children.clear();
  children.addAll(copy);
}

classes read / write ​

CssClassSet get classes

The set of CSS classes applied to this element.

This set makes it easy to add, remove or toggle the classes applied to this element.

dart
element.classes.add('selected');
element.classes.toggle('isOnline');
element.classes.remove('selected');
Implementation
dart
CssClassSet get classes => new _ElementCssClassSet(this);

set classes(Iterable<String> value) {
  &#47;&#47; TODO(sra): Do this without reading the classes in clear() and addAll(),
  &#47;&#47; or writing the classes in clear().
  CssClassSet classSet = classes;
  classSet.clear();
  classSet.addAll(value);
}

className read / write ​

String get className
Implementation
dart
String get className native;

set className(String value) native;

client no setter ​

Rectangle<num> get client

Gets the position of this element relative to the client area of the page.

Implementation
dart
Rectangle get client =>
    new Rectangle(clientLeft!, clientTop!, clientWidth, clientHeight);

clientHeight no setter ​

int get clientHeight
Implementation
dart
int get clientHeight native;

clientLeft no setter ​

int? get clientLeft
Implementation
dart
int? get clientLeft native;

clientTop no setter ​

int? get clientTop
Implementation
dart
int? get clientTop native;

clientWidth no setter ​

int get clientWidth
Implementation
dart
int get clientWidth native;

computedName no setter ​

String? get computedName
Implementation
dart
String? get computedName native;

computedRole no setter ​

String? get computedRole
Implementation
dart
String? get computedRole native;

contentEdge no setter ​

CssRect get contentEdge

Access this element's content position.

This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not.

Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow

Implementation
dart
CssRect get contentEdge => new _ContentCssRect(this);

contentEditable read / write ​

String get contentEditable
Implementation
dart
String get contentEditable native;

set contentEditable(String value) native;

dataset read / write ​

Map<String, String> get dataset

Allows access to all custom data attributes (data-*) set on this element.

Any data attributes in the markup will be converted to camel-cased keys in the map based on these conversion rules.

For example, HTML specified as:

dart
<div data-my-random-value='value'></div>

Would be accessed in Dart as:

dart
var value = element.dataset['myRandomValue'];

See also:

Implementation
dart
Map<String, String> get dataset => new _DataAttributeMap(attributes);

set dataset(Map<String, String> value) {
  final data = this.dataset;
  data.clear();
  for (String key in value.keys) {
    data[key] = value[key]!;
  }
}

dir read / write ​

String? get dir
Implementation
dart
String? get dir native;

set dir(String? value) native;

documentOffset no setter ​

Point<num> get documentOffset

Provides the coordinates of the element relative to the top of the document.

This method is the Dart equivalent to jQuery's offset method.

Implementation
dart
Point get documentOffset => offsetTo(document.documentElement!);

draggable read / write ​

bool get draggable

Indicates whether the element can be dragged and dropped.

Other resources ​

Implementation
dart
bool get draggable native;

set draggable(bool value) native;

firstChild no setter inherited ​

Node? get firstChild

The first child of this node.

Other resources ​

Inherited from Node.

Implementation
dart
Node? get firstChild native;

hashCode no setter inherited ​

int get hashCode

Inherited from Interceptor.

Implementation
dart
int get hashCode => Primitives.objectHashCode(this);

hidden read / write ​

bool get hidden

Indicates whether the element is not relevant to the page's current state.

Other resources ​

Implementation
dart
bool get hidden native;

set hidden(bool value) native;

id read / write ​

String get id
Implementation
dart
String get id native;

set id(String value) native;

inert read / write ​

bool? get inert
Implementation
dart
bool? get inert native;

set inert(bool? value) native;

innerHtml read / write ​

String? get innerHtml

Parses the HTML fragment and sets it as the contents of this element.

This uses the default sanitization behavior to sanitize the HTML fragment, use setInnerHtml to override the default behavior.

Implementation
dart
String? get innerHtml => _innerHtml;

set innerHtml(String? html) {
  this.setInnerHtml(html);
}

innerText read / write ​

String get innerText
Implementation
dart
@JSName('innerText')
String get innerText native;

set innerText(String value) native;

inputMode read / write ​

String? get inputMode
Implementation
dart
String? get inputMode native;

set inputMode(String? value) native;

isConnected no setter inherited ​

bool? get isConnected

Inherited from Node.

Implementation
dart
bool? get isConnected native;

isContentEditable no setter ​

bool? get isContentEditable
Implementation
dart
bool? get isContentEditable native;

lang read / write ​

String? get lang
Implementation
dart
String? get lang native;

set lang(String? value) native;

lastChild no setter inherited ​

Node? get lastChild

The last child of this node.

Other resources ​

Inherited from Node.

Implementation
dart
Node? get lastChild native;

localName no setter ​

String get localName
Implementation
dart
@Returns('String')
&#47;&#47; Non-null for Elements.
String get localName => JS('String', '#', _localName);

marginEdge no setter ​

CssRect get marginEdge

Access the dimensions and position of this element's content + padding + border + margin box.

This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not. This can be used to retrieve jQuery's outerHeight value for an element.

Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow

Implementation
dart
CssRect get marginEdge => new _MarginCssRect(this);

namespaceUri no setter ​

String? get namespaceUri

A URI that identifies the XML namespace of this element.

null if no namespace URI is specified.

Other resources ​

Implementation
dart
String? get namespaceUri => _namespaceUri;

nextElementSibling no setter override ​

Element? get nextElementSibling
Implementation
dart
Element? get nextElementSibling native;

nextNode no setter inherited ​

Node? get nextNode

The next sibling node.

Other resources ​

Inherited from Node.

Implementation
dart
@JSName('nextSibling')
&#47;**
 * The next sibling node.
 *
 * ## Other resources
 *
 * * [Node.nextSibling](https:&#47;&#47;developer.mozilla.org&#47;en-US&#47;docs&#47;Web&#47;API&#47;Node.nextSibling)
 *   from MDN.
 *&#47;
Node? get nextNode native;

nodeName no setter inherited ​

String? get nodeName

The name of this node.

This varies by this node's nodeType.

Other resources ​

Inherited from Node.

Implementation
dart
String? get nodeName native;

nodes read / write inherited ​

List<Node> get nodes

A modifiable list of this node's children.

Inherited from Node.

Implementation
dart
List<Node> get nodes {
  return new _ChildNodeListLazy(this);
}

set nodes(Iterable<Node> value) {
  &#47;&#47; Copy list first since we don't want liveness during iteration.
  &#47;&#47; TODO(jacobr): there is a better way to do this.
  var copy = value.toList();
  text = '';
  for (Node node in copy) {
    append(node);
  }
}

nodeType no setter inherited ​

int get nodeType

The type of node.

This value is one of:

Other resources ​

Inherited from Node.

Implementation
dart
int get nodeType native;

nodeValue no setter inherited ​

String? get nodeValue

The value of this node.

This varies by this type's nodeType.

Other resources ​

Inherited from Node.

Implementation
dart
String? get nodeValue native;

offset no setter ​

Rectangle<num> get offset

Gets the offset of this element relative to its offsetParent.

Implementation
dart
Rectangle get offset =>
    new Rectangle(offsetLeft, offsetTop, offsetWidth, offsetHeight);

offsetHeight no setter ​

int get offsetHeight
Implementation
dart
int get offsetHeight => JS<num>('num', '#.offsetHeight', this).round();

offsetLeft no setter ​

int get offsetLeft
Implementation
dart
int get offsetLeft => JS<num>('num', '#.offsetLeft', this).round();

offsetParent no setter ​

Element? get offsetParent
Implementation
dart
Element? get offsetParent native;

offsetTop no setter ​

int get offsetTop
Implementation
dart
int get offsetTop => JS<num>('num', '#.offsetTop', this).round();

offsetWidth no setter ​

int get offsetWidth
Implementation
dart
int get offsetWidth => JS<num>('num', '#.offsetWidth', this).round();

on no setter override ​

This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.

Implementation
dart
ElementEvents get on => new ElementEvents(this);

onAbort no setter override ​

ElementStream<Event> get onAbort

Stream of abort events handled by this Element.

Implementation
dart
ElementStream<Event> get onAbort => abortEvent.forElement(this);

onBeforeCopy no setter ​

ElementStream<Event> get onBeforeCopy

Stream of beforecopy events handled by this Element.

Implementation
dart
ElementStream<Event> get onBeforeCopy => beforeCopyEvent.forElement(this);

onBeforeCut no setter ​

ElementStream<Event> get onBeforeCut

Stream of beforecut events handled by this Element.

Implementation
dart
ElementStream<Event> get onBeforeCut => beforeCutEvent.forElement(this);

onBeforePaste no setter ​

ElementStream<Event> get onBeforePaste

Stream of beforepaste events handled by this Element.

Implementation
dart
ElementStream<Event> get onBeforePaste => beforePasteEvent.forElement(this);

onBlur no setter override ​

ElementStream<Event> get onBlur

Stream of blur events handled by this Element.

Implementation
dart
ElementStream<Event> get onBlur => blurEvent.forElement(this);

onCanPlay no setter override ​

ElementStream<Event> get onCanPlay
Implementation
dart
ElementStream<Event> get onCanPlay => canPlayEvent.forElement(this);

onCanPlayThrough no setter override ​

ElementStream<Event> get onCanPlayThrough
Implementation
dart
ElementStream<Event> get onCanPlayThrough =>
    canPlayThroughEvent.forElement(this);

onChange no setter override ​

ElementStream<Event> get onChange

Stream of change events handled by this Element.

Implementation
dart
ElementStream<Event> get onChange => changeEvent.forElement(this);

onClick no setter override ​

Stream of click events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onClick => clickEvent.forElement(this);

onContextMenu no setter override ​

ElementStream<MouseEvent> get onContextMenu

Stream of contextmenu events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onContextMenu =>
    contextMenuEvent.forElement(this);

onCopy no setter ​

Stream of copy events handled by this Element.

Implementation
dart
ElementStream<ClipboardEvent> get onCopy => copyEvent.forElement(this);

onCut no setter ​

Stream of cut events handled by this Element.

Implementation
dart
ElementStream<ClipboardEvent> get onCut => cutEvent.forElement(this);

onDoubleClick no setter override ​

ElementStream<Event> get onDoubleClick

Stream of doubleclick events handled by this Element.

Implementation
dart
@DomName('Element.ondblclick')
ElementStream<Event> get onDoubleClick => doubleClickEvent.forElement(this);

onDrag no setter override ​

A stream of drag events fired when this element currently being dragged.

A drag event is added to this stream as soon as the drag begins. A drag event is also added to this stream at intervals while the drag operation is still ongoing.

Other resources ​

Implementation
dart
ElementStream<MouseEvent> get onDrag => dragEvent.forElement(this);

onDragEnd no setter override ​

ElementStream<MouseEvent> get onDragEnd

A stream of dragend events fired when this element completes a drag operation.

Other resources ​

Implementation
dart
ElementStream<MouseEvent> get onDragEnd => dragEndEvent.forElement(this);

onDragEnter no setter override ​

ElementStream<MouseEvent> get onDragEnter

A stream of dragenter events fired when a dragged object is first dragged over this element.

Other resources ​

Implementation
dart
ElementStream<MouseEvent> get onDragEnter => dragEnterEvent.forElement(this);

onDragLeave no setter override ​

ElementStream<MouseEvent> get onDragLeave

A stream of dragleave events fired when an object being dragged over this element leaves this element's target area.

Other resources ​

Implementation
dart
ElementStream<MouseEvent> get onDragLeave => dragLeaveEvent.forElement(this);

onDragOver no setter override ​

ElementStream<MouseEvent> get onDragOver

A stream of dragover events fired when a dragged object is currently being dragged over this element.

Other resources ​

Implementation
dart
ElementStream<MouseEvent> get onDragOver => dragOverEvent.forElement(this);

onDragStart no setter override ​

ElementStream<MouseEvent> get onDragStart

A stream of dragstart events fired when this element starts being dragged.

Other resources ​

Implementation
dart
ElementStream<MouseEvent> get onDragStart => dragStartEvent.forElement(this);

onDrop no setter override ​

A stream of drop events fired when a dragged object is dropped on this element.

Other resources ​

Implementation
dart
ElementStream<MouseEvent> get onDrop => dropEvent.forElement(this);

onDurationChange no setter override ​

ElementStream<Event> get onDurationChange
Implementation
dart
ElementStream<Event> get onDurationChange =>
    durationChangeEvent.forElement(this);

onEmptied no setter override ​

ElementStream<Event> get onEmptied
Implementation
dart
ElementStream<Event> get onEmptied => emptiedEvent.forElement(this);

onEnded no setter override ​

ElementStream<Event> get onEnded
Implementation
dart
ElementStream<Event> get onEnded => endedEvent.forElement(this);

onError no setter override ​

ElementStream<Event> get onError

Stream of error events handled by this Element.

Implementation
dart
ElementStream<Event> get onError => errorEvent.forElement(this);

onFocus no setter override ​

ElementStream<Event> get onFocus

Stream of focus events handled by this Element.

Implementation
dart
ElementStream<Event> get onFocus => focusEvent.forElement(this);

onFullscreenChange no setter ​

ElementStream<Event> get onFullscreenChange

Stream of fullscreenchange events handled by this Element.

Implementation
dart
ElementStream<Event> get onFullscreenChange =>
    fullscreenChangeEvent.forElement(this);

onFullscreenError no setter ​

ElementStream<Event> get onFullscreenError

Stream of fullscreenerror events handled by this Element.

Implementation
dart
ElementStream<Event> get onFullscreenError =>
    fullscreenErrorEvent.forElement(this);

onInput no setter override ​

ElementStream<Event> get onInput

Stream of input events handled by this Element.

Implementation
dart
ElementStream<Event> get onInput => inputEvent.forElement(this);

onInvalid no setter override ​

ElementStream<Event> get onInvalid

Stream of invalid events handled by this Element.

Implementation
dart
ElementStream<Event> get onInvalid => invalidEvent.forElement(this);

onKeyDown no setter override ​

Stream of keydown events handled by this Element.

Implementation
dart
ElementStream<KeyboardEvent> get onKeyDown => keyDownEvent.forElement(this);

onKeyPress no setter override ​

Stream of keypress events handled by this Element.

Implementation
dart
ElementStream<KeyboardEvent> get onKeyPress => keyPressEvent.forElement(this);

onKeyUp no setter override ​

Stream of keyup events handled by this Element.

Implementation
dart
ElementStream<KeyboardEvent> get onKeyUp => keyUpEvent.forElement(this);

onLoad no setter override ​

ElementStream<Event> get onLoad

Stream of load events handled by this Element.

Implementation
dart
ElementStream<Event> get onLoad => loadEvent.forElement(this);

onLoadedData no setter override ​

ElementStream<Event> get onLoadedData
Implementation
dart
ElementStream<Event> get onLoadedData => loadedDataEvent.forElement(this);

onLoadedMetadata no setter override ​

ElementStream<Event> get onLoadedMetadata
Implementation
dart
ElementStream<Event> get onLoadedMetadata =>
    loadedMetadataEvent.forElement(this);

onMouseDown no setter override ​

ElementStream<MouseEvent> get onMouseDown

Stream of mousedown events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onMouseDown => mouseDownEvent.forElement(this);

onMouseEnter no setter override ​

ElementStream<MouseEvent> get onMouseEnter

Stream of mouseenter events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onMouseEnter =>
    mouseEnterEvent.forElement(this);

onMouseLeave no setter override ​

ElementStream<MouseEvent> get onMouseLeave

Stream of mouseleave events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onMouseLeave =>
    mouseLeaveEvent.forElement(this);

onMouseMove no setter override ​

ElementStream<MouseEvent> get onMouseMove

Stream of mousemove events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onMouseMove => mouseMoveEvent.forElement(this);

onMouseOut no setter override ​

ElementStream<MouseEvent> get onMouseOut

Stream of mouseout events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onMouseOut => mouseOutEvent.forElement(this);

onMouseOver no setter override ​

ElementStream<MouseEvent> get onMouseOver

Stream of mouseover events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onMouseOver => mouseOverEvent.forElement(this);

onMouseUp no setter override ​

ElementStream<MouseEvent> get onMouseUp

Stream of mouseup events handled by this Element.

Implementation
dart
ElementStream<MouseEvent> get onMouseUp => mouseUpEvent.forElement(this);

onMouseWheel no setter override ​

ElementStream<WheelEvent> get onMouseWheel

Stream of mousewheel events handled by this Element.

Implementation
dart
ElementStream<WheelEvent> get onMouseWheel =>
    mouseWheelEvent.forElement(this);

onPaste no setter ​

Stream of paste events handled by this Element.

Implementation
dart
ElementStream<ClipboardEvent> get onPaste => pasteEvent.forElement(this);

onPause no setter override ​

ElementStream<Event> get onPause
Implementation
dart
ElementStream<Event> get onPause => pauseEvent.forElement(this);

onPlay no setter override ​

ElementStream<Event> get onPlay
Implementation
dart
ElementStream<Event> get onPlay => playEvent.forElement(this);

onPlaying no setter override ​

ElementStream<Event> get onPlaying
Implementation
dart
ElementStream<Event> get onPlaying => playingEvent.forElement(this);

onRateChange no setter override ​

ElementStream<Event> get onRateChange
Implementation
dart
ElementStream<Event> get onRateChange => rateChangeEvent.forElement(this);

onReset no setter override ​

ElementStream<Event> get onReset

Stream of reset events handled by this Element.

Implementation
dart
ElementStream<Event> get onReset => resetEvent.forElement(this);

onResize no setter override ​

ElementStream<Event> get onResize
Implementation
dart
ElementStream<Event> get onResize => resizeEvent.forElement(this);

onScroll no setter override ​

ElementStream<Event> get onScroll

Stream of scroll events handled by this Element.

Implementation
dart
ElementStream<Event> get onScroll => scrollEvent.forElement(this);

onSearch no setter ​

ElementStream<Event> get onSearch

Stream of search events handled by this Element.

Implementation
dart
ElementStream<Event> get onSearch => searchEvent.forElement(this);

onSeeked no setter override ​

ElementStream<Event> get onSeeked
Implementation
dart
ElementStream<Event> get onSeeked => seekedEvent.forElement(this);

onSeeking no setter override ​

ElementStream<Event> get onSeeking
Implementation
dart
ElementStream<Event> get onSeeking => seekingEvent.forElement(this);

onSelect no setter override ​

ElementStream<Event> get onSelect

Stream of select events handled by this Element.

Implementation
dart
ElementStream<Event> get onSelect => selectEvent.forElement(this);

onSelectStart no setter ​

ElementStream<Event> get onSelectStart

Stream of selectstart events handled by this Element.

Implementation
dart
ElementStream<Event> get onSelectStart => selectStartEvent.forElement(this);

onStalled no setter override ​

ElementStream<Event> get onStalled
Implementation
dart
ElementStream<Event> get onStalled => stalledEvent.forElement(this);

onSubmit no setter override ​

ElementStream<Event> get onSubmit

Stream of submit events handled by this Element.

Implementation
dart
ElementStream<Event> get onSubmit => submitEvent.forElement(this);

onSuspend no setter override ​

ElementStream<Event> get onSuspend
Implementation
dart
ElementStream<Event> get onSuspend => suspendEvent.forElement(this);

onTimeUpdate no setter override ​

ElementStream<Event> get onTimeUpdate
Implementation
dart
ElementStream<Event> get onTimeUpdate => timeUpdateEvent.forElement(this);

onTouchCancel no setter override ​

ElementStream<TouchEvent> get onTouchCancel

Stream of touchcancel events handled by this Element.

Implementation
dart
ElementStream<TouchEvent> get onTouchCancel =>
    touchCancelEvent.forElement(this);

onTouchEnd no setter override ​

ElementStream<TouchEvent> get onTouchEnd

Stream of touchend events handled by this Element.

Implementation
dart
ElementStream<TouchEvent> get onTouchEnd => touchEndEvent.forElement(this);

onTouchEnter no setter ​

ElementStream<TouchEvent> get onTouchEnter

Stream of touchenter events handled by this Element.

Implementation
dart
ElementStream<TouchEvent> get onTouchEnter =>
    touchEnterEvent.forElement(this);

onTouchLeave no setter ​

ElementStream<TouchEvent> get onTouchLeave

Stream of touchleave events handled by this Element.

Implementation
dart
ElementStream<TouchEvent> get onTouchLeave =>
    touchLeaveEvent.forElement(this);

onTouchMove no setter override ​

ElementStream<TouchEvent> get onTouchMove

Stream of touchmove events handled by this Element.

Implementation
dart
ElementStream<TouchEvent> get onTouchMove => touchMoveEvent.forElement(this);

onTouchStart no setter override ​

ElementStream<TouchEvent> get onTouchStart

Stream of touchstart events handled by this Element.

Implementation
dart
ElementStream<TouchEvent> get onTouchStart =>
    touchStartEvent.forElement(this);

onTransitionEnd no setter ​

ElementStream<TransitionEvent> get onTransitionEnd

Stream of transitionend events handled by this Element.

Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
ElementStream<TransitionEvent> get onTransitionEnd =>
    transitionEndEvent.forElement(this);

onVolumeChange no setter override ​

ElementStream<Event> get onVolumeChange
Implementation
dart
ElementStream<Event> get onVolumeChange => volumeChangeEvent.forElement(this);

onWaiting no setter override ​

ElementStream<Event> get onWaiting
Implementation
dart
ElementStream<Event> get onWaiting => waitingEvent.forElement(this);

onWheel no setter override ​

Implementation
dart
ElementStream<WheelEvent> get onWheel => wheelEvent.forElement(this);

outerHtml no setter ​

String? get outerHtml
Implementation
dart
@JSName('outerHTML')
String? get outerHtml native;

ownerDocument no setter inherited ​

Document? get ownerDocument

The document this node belongs to.

Returns null if this node does not belong to any document.

Other resources ​

Inherited from Node.

Implementation
dart
Document? get ownerDocument native;

paddingEdge no setter ​

CssRect get paddingEdge

Access the dimensions and position of this element's content + padding box.

This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not. This can be used to retrieve jQuery's innerHeight value for an element. This is also a rectangle equalling the dimensions of clientHeight and clientWidth.

Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow

Implementation
dart
CssRect get paddingEdge => new _PaddingCssRect(this);

parent no setter inherited ​

Element? get parent

The parent element of this node.

Returns null if this node either does not have a parent or its parent is not an element.

Other resources ​

Inherited from Node.

Implementation
dart
@JSName('parentElement')
&#47;**
 * The parent element of this node.
 *
 * Returns null if this node either does not have a parent or its parent is
 * not an element.
 *
 * ## Other resources
 *
 * * [Node.parentElement](https:&#47;&#47;developer.mozilla.org&#47;en-US&#47;docs&#47;Web&#47;API&#47;Node.parentElement)
 *   from W3C.
 *&#47;
Element? get parent native;

parentNode no setter inherited ​

Node? get parentNode

The parent node of this node.

Other resources ​

Inherited from Node.

Implementation
dart
Node? get parentNode native;

previousElementSibling no setter override ​

Element? get previousElementSibling
Implementation
dart
Element? get previousElementSibling native;

previousNode no setter inherited ​

Node? get previousNode

The previous sibling node.

Other resources ​

Inherited from Node.

Implementation
dart
@JSName('previousSibling')
&#47;**
 * The previous sibling node.
 *
 * ## Other resources
 *
 * * [Node.previousSibling](https:&#47;&#47;developer.mozilla.org&#47;en-US&#47;docs&#47;Web&#47;API&#47;Node.previousSibling)
 *   from MDN.
 *&#47;
Node? get previousNode native;

runtimeType no setter inherited ​

Type get runtimeType

Inherited from Interceptor.

Implementation
dart
Type get runtimeType =>
    getRuntimeTypeOfInterceptorNotArray(getInterceptor(this), this);

scrollHeight no setter ​

int get scrollHeight
Implementation
dart
int get scrollHeight => JS<num>('num', '#.scrollHeight', this).round();

scrollLeft read / write ​

int get scrollLeft
Implementation
dart
int get scrollLeft => JS<num>('num', '#.scrollLeft', this).round();

set scrollLeft(int value) {
  JS("void", "#.scrollLeft = #", this, value.round());
}

scrollTop read / write ​

int get scrollTop
Implementation
dart
int get scrollTop => JS<num>('num', '#.scrollTop', this).round();

set scrollTop(int value) {
  JS("void", "#.scrollTop = #", this, value.round());
}

scrollWidth no setter ​

int get scrollWidth
Implementation
dart
int get scrollWidth => JS<num>('num', '#.scrollWidth', this).round();

shadowRoot no setter ​

ShadowRoot? get shadowRoot

The shadow root of this shadow host.

Other resources ​

Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME, '25')
ShadowRoot? get shadowRoot =>
    JS('ShadowRoot|Null', '#.shadowRoot || #.webkitShadowRoot', this, this);

slot read / write ​

String? get slot
Implementation
dart
String? get slot native;

set slot(String? value) native;

spellcheck read / write ​

bool? get spellcheck
Implementation
dart
bool? get spellcheck native;

set spellcheck(bool? value) native;

style no setter ​

Implementation
dart
CssStyleDeclaration get style native;

styleMap no setter ​

StylePropertyMap? get styleMap
Implementation
dart
StylePropertyMap? get styleMap native;

tabIndex read / write ​

int? get tabIndex
Implementation
dart
int? get tabIndex native;

set tabIndex(int? value) native;

tagName no setter ​

String get tagName
Implementation
dart
String get tagName native;

text read / write inherited ​

String? get text

All text within this node and its descendants.

Other resources ​

Inherited from Node.

Implementation
dart
@JSName('textContent')
&#47;**
 * All text within this node and its descendants.
 *
 * ## Other resources
 *
 * * [Node.textContent](https:&#47;&#47;developer.mozilla.org&#47;en-US&#47;docs&#47;Web&#47;API&#47;Node.textContent)
 *   from MDN.
 *&#47;
String? get text native;

@JSName('textContent')
set text(String? value) native;

title read / write ​

String? get title
Implementation
dart
String? get title native;

set title(String? value) native;

translate read / write ​

bool? get translate

Specifies whether this element's text content changes when the page is localized.

Other resources ​

Implementation
dart
bool? get translate native;

set translate(bool? value) native;

Methods ​

addEventListener() inherited ​

void addEventListener(
  String type,
  (dynamic Function(Event event))? listener, [
  bool? useCapture,
])

Inherited from EventTarget.

Implementation
dart
void addEventListener(
  String type,
  EventListener? listener, [
  bool? useCapture,
]) {
  &#47;&#47; TODO(leafp): This check is avoid a bug in our dispatch code when
  &#47;&#47; listener is null.  The browser treats this call as a no-op in this
  &#47;&#47; case, so it's fine to short-circuit it, but we should not have to.
  if (listener != null) {
    _addEventListener(type, listener, useCapture);
  }
}

after() override ​

void after(Object nodes)
Implementation
dart
void after(Object nodes) native;

animate() ​

Animation animate(Iterable<Map<String, dynamic>> frames, [dynamic timing])

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.

Examples

dart
var animation = elem.animate([{"opacity": 75}, {"opacity": 0}], 200);

var animation = elem.animate([
  {"transform": "translate(100px, -100%)"},
  {"transform" : "translate(400px, 500px)"}
], 1500);

The frames parameter is an Iterable<Map>, where the map entries specify CSS animation effects. The timing parameter can be a double, representing the number of milliseconds for the transition, or a Map with fields corresponding to those of the timing object.

Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME, '36')
Animation animate(Iterable<Map<String, dynamic>> frames, [timing]) {
  if (frames is! Iterable || !(frames.every((x) => x is Map))) {
    throw new ArgumentError(
      "The frames parameter should be a List of Maps "
      "with frame information",
    );
  }
  var convertedFrames;
  if (frames is Iterable) {
    convertedFrames = frames.map(convertDartToNative_Dictionary).toList();
  } else {
    convertedFrames = frames;
  }
  var convertedTiming = timing is Map
      ? convertDartToNative_Dictionary(timing)
      : timing;
  return convertedTiming == null
      ? _animate(convertedFrames)
      : _animate(convertedFrames, convertedTiming);
}

append() inherited ​

Node append(Node node)

Adds a node to the end of the child nodes list of this node.

If the node already exists in this document, it will be removed from its current parent node, then added to this node.

This method is more efficient than nodes.add, and is the preferred way of appending a child node.

Inherited from Node.

Implementation
dart
@JSName('appendChild')
&#47;**
 * Adds a node to the end of the child [nodes] list of this node.
 *
 * If the node already exists in this document, it will be removed from its
 * current parent node, then added to this node.
 *
 * This method is more efficient than `nodes.add`, and is the preferred
 * way of appending a child node.
 *&#47;
Node append(Node node) native;

appendHtml() ​

void appendHtml(
  String text, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
})

Parses the specified text as HTML and adds the resulting node after the last child of this element.

Implementation
dart
void appendHtml(
  String text, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
}) {
  this.insertAdjacentHtml(
    'beforeend',
    text,
    validator: validator,
    treeSanitizer: treeSanitizer,
  );
}

appendText() ​

void appendText(String text)

Adds the specified text after the last child of this element.

Implementation
dart
void appendText(String text) {
  this.append(new Text(text));
}

attached() ​

void attached()

Called by the DOM when this element has been inserted into the live document.

Warning: This API is part of multiple custom element APIs that are no longer supported.

Implementation
dart
void attached() {
  &#47;&#47; For the deprecation period, call the old callback.
  enteredView();
}

attachShadow() ​

ShadowRoot attachShadow(Map<dynamic, dynamic> shadowRootInitDict)
Implementation
dart
ShadowRoot attachShadow(Map shadowRootInitDict) {
  var shadowRootInitDict_1 = convertDartToNative_Dictionary(
    shadowRootInitDict,
  );
  return _attachShadow_1(shadowRootInitDict_1);
}

attributeChanged() ​

void attributeChanged(String name, String oldValue, String newValue)

Called by the DOM whenever an attribute on this has been changed.

Implementation
dart
void attributeChanged(String name, String oldValue, String newValue) {}

before() override ​

void before(Object nodes)
Implementation
dart
void before(Object nodes) native;

blur() ​

void blur()
Implementation
dart
void blur() native;

click() ​

void click()
Implementation
dart
void click() native;

clone() inherited ​

Node clone(bool? deep)

Returns a copy of this node.

If deep is true, then all of this node's children and descendants are copied as well. If deep is false, then only this node is copied.

Other resources ​

Inherited from Node.

Implementation
dart
@JSName('cloneNode')
&#47;**
 * Returns a copy of this node.
 *
 * If [deep] is `true`, then all of this node's children and descendants are
 * copied as well. If [deep] is `false`, then only this node is copied.
 *
 * ## Other resources
 *
 * * [Node.cloneNode](https:&#47;&#47;developer.mozilla.org&#47;en-US&#47;docs&#47;Web&#47;API&#47;Node.cloneNode)
 *   from MDN.
 *&#47;
Node clone(bool? deep) native;

closest() ​

Element? closest(String selectors)
Implementation
dart
Element? closest(String selectors) native;

contains() inherited ​

bool contains(Node? other)

Returns true if this node contains the specified node.

Other resources ​

Inherited from Node.

Implementation
dart
bool contains(Node? other) native;

createFragment() ​

DocumentFragment createFragment(
  String? html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
})

Create a DocumentFragment from the HTML fragment and ensure that it follows the sanitization rules specified by the validator or treeSanitizer.

If the default validation behavior is too restrictive then a new NodeValidator should be created, either extending or wrapping a default validator and overriding the validation APIs.

The treeSanitizer is used to walk the generated node tree and sanitize it. A custom treeSanitizer can also be provided to perform special validation rules but since the API is more complex to implement this is discouraged.

The returned tree is guaranteed to only contain nodes and attributes which are allowed by the provided validator.

See also:

Implementation
dart
DocumentFragment createFragment(
  String? html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
}) {
  if (treeSanitizer == null) {
    if (validator == null) {
      if (_defaultValidator == null) {
        _defaultValidator = new NodeValidatorBuilder.common();
      }
      validator = _defaultValidator;
    }
    if (_defaultSanitizer == null) {
      _defaultSanitizer = new _ValidatingTreeSanitizer(validator!);
    } else {
      _defaultSanitizer!.validator = validator!;
    }
    treeSanitizer = _defaultSanitizer;
  } else if (validator != null) {
    throw new ArgumentError(
      'validator can only be passed if treeSanitizer is null',
    );
  }

  if (_parseDocument == null) {
    _parseDocument = document.implementation!.createHtmlDocument('');
    _parseRange = _parseDocument!.createRange();

    &#47;&#47; Workaround for Safari bug. Was also previously Chrome bug 229142
    &#47;&#47; - URIs are not resolved in new doc.
    BaseElement base = _parseDocument!.createElement('base') as BaseElement;
    base.href = document.baseUri!;
    _parseDocument!.head!.append(base);
  }

  &#47;&#47; TODO(terry): Fixes Chromium 50 change no body after createHtmlDocument()
  if (_parseDocument!.body == null) {
    _parseDocument!.body =
        _parseDocument!.createElement("body") as BodyElement;
  }

  Element contextElement;
  if (this is BodyElement) {
    contextElement = _parseDocument!.body!;
  } else {
    contextElement = _parseDocument!.createElement(tagName);
    _parseDocument!.body!.append(contextElement);
  }
  DocumentFragment fragment;
  if (Range.supportsCreateContextualFragment &&
      _canBeUsedToCreateContextualFragment) {
    _parseRange!.selectNodeContents(contextElement);
    &#47;&#47; createContextualFragment expects a non-nullable html string.
    &#47;&#47; If null is passed, it gets converted to 'null' instead.
    fragment = _parseRange!.createContextualFragment(html ?? 'null');
  } else {
    contextElement._innerHtml = html;

    fragment = _parseDocument!.createDocumentFragment();
    while (contextElement.firstChild != null) {
      fragment.append(contextElement.firstChild!);
    }
  }
  if (contextElement != _parseDocument!.body) {
    contextElement.remove();
  }

  treeSanitizer!.sanitizeTree(fragment);
  &#47;&#47; Copy the fragment over to the main document (fix for 14184)
  document.adoptNode(fragment);

  return fragment;
}

createShadowRoot() ​

ShadowRoot createShadowRoot()

Creates a new shadow root for this shadow host.

Other resources ​

Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME, '25')
ShadowRoot createShadowRoot() {
  return JS(
    'ShadowRoot',
    '(#.createShadowRoot || #.webkitCreateShadowRoot).call(#)',
    this,
    this,
    this,
  );
}

detached() ​

void detached()

Called by the DOM when this element has been removed from the live document.

Warning: This API is part of multiple custom element APIs that are no longer supported. draft specification.

Implementation
dart
void detached() {
  &#47;&#47; For the deprecation period, call the old callback.
  leftView();
}

dispatchEvent() inherited ​

bool dispatchEvent(Event event)

Inherited from EventTarget.

Implementation
dart
bool dispatchEvent(Event event) native;

deprecated enteredView() ​

void enteredView()

DEPRECATED

next release

Deprecated*: override attached instead.

Implementation
dart
@deprecated
void enteredView() {}

focus() ​

void focus()
Implementation
dart
void focus() native;

getAnimations() ​

List<Animation> getAnimations()
Implementation
dart
List<Animation> getAnimations() native;

getAttribute() ​

String? getAttribute(String name)
Implementation
dart
@pragma('dart2js:tryInline')
String? getAttribute(String name) {
  &#47;&#47; TODO(41258): Delete this assertion after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  assert(name != null, 'Attribute name cannot be null');
  return _getAttribute(name);
}

getAttributeNames() ​

List<String> getAttributeNames()
Implementation
dart
List<String> getAttributeNames() native;

getAttributeNS() ​

String? getAttributeNS(String? namespaceURI, String name)
Implementation
dart
@pragma('dart2js:tryInline')
String? getAttributeNS(String? namespaceURI, String name) {
  &#47;&#47; TODO(41258): Delete this assertion after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  &#47;&#47; [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
  assert(name != null, 'Attribute name cannot be null');
  return _getAttributeNS(namespaceURI, name);
}

getBoundingClientRect() ​

Rectangle<num> getBoundingClientRect()

Returns the smallest bounding rectangle that encompasses this element's padding, scrollbar, and border.

Other resources ​

Implementation
dart
@Creates('_DomRect')
@Returns('_DomRect|Null')
Rectangle getBoundingClientRect() native;

getClientRects() ​

List<Rectangle<num>> getClientRects()
Implementation
dart
List<Rectangle> getClientRects() {
  var value = _getClientRects();

  &#47;&#47; If no prototype we need one for the world to hookup to the proper Dart class.
  var jsProto = JS('', '#.prototype', value);
  if (jsProto == null) {
    JS('', '#.prototype = Object.create(null)', value);
  }

  applyExtension('DOMRectList', value);

  return value;
}

getComputedStyle() ​

CssStyleDeclaration getComputedStyle([String? pseudoElement])

The set of all CSS values applied to this element, including inherited and default values.

The computedStyle contains values that are inherited from other sources, such as parent elements or stylesheets. This differs from the style property, which contains only the values specified directly on this element.

PseudoElement can be values such as ::after, ::before, ::marker, ::line-marker.

See also:

Implementation
dart
CssStyleDeclaration getComputedStyle([String? pseudoElement]) {
  if (pseudoElement == null) {
    pseudoElement = '';
  }
  &#47;&#47; TODO(jacobr): last param should be null, see b&#47;5045788
  return window._getComputedStyle(this, pseudoElement);
}

getDestinationInsertionPoints() ​

List<Node> getDestinationInsertionPoints()

Returns a list of shadow DOM insertion points to which this element is distributed.

Other resources ​

Implementation
dart
@Returns('NodeList')
@Creates('NodeList')
List<Node> getDestinationInsertionPoints() native;

getElementsByClassName() ​

List<Node> getElementsByClassName(String classNames)

Returns a list of nodes with the given class name inside this element.

Other resources ​

Implementation
dart
@Creates('NodeList|HtmlCollection')
@Returns('NodeList|HtmlCollection')
List<Node> getElementsByClassName(String classNames) native;

getNamespacedAttributes() ​

Map<String, String> getNamespacedAttributes(String namespace)

Gets a map for manipulating the attributes of a particular namespace.

This is primarily useful for SVG attributes such as xref:link.

Implementation
dart
Map<String, String> getNamespacedAttributes(String namespace) {
  return new _NamespacedAttributeMap(this, namespace);
}

getRootNode() inherited ​

Node getRootNode([Map<dynamic, dynamic>? options])

Inherited from Node.

Implementation
dart
Node getRootNode([Map? options]) {
  if (options != null) {
    var options_1 = convertDartToNative_Dictionary(options);
    return _getRootNode_1(options_1);
  }
  return _getRootNode_2();
}

hasAttribute() ​

bool hasAttribute(String name)
Implementation
dart
@pragma('dart2js:tryInline')
bool hasAttribute(String name) {
  &#47;&#47; TODO(41258): Delete this assertion after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  assert(name != null, 'Attribute name cannot be null');
  return _hasAttribute(name);
}

hasAttributeNS() ​

bool hasAttributeNS(String? namespaceURI, String name)
Implementation
dart
@pragma('dart2js:tryInline')
bool hasAttributeNS(String? namespaceURI, String name) {
  &#47;&#47; TODO(41258): Delete this assertion after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  &#47;&#47; [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
  assert(name != null, 'Attribute name cannot be null');
  return _hasAttributeNS(namespaceURI, name);
}

hasChildNodes() inherited ​

bool hasChildNodes()

Returns true if this node has any children.

Other resources ​

Inherited from Node.

Implementation
dart
bool hasChildNodes() native;

hasPointerCapture() ​

bool hasPointerCapture(int pointerId)
Implementation
dart
bool hasPointerCapture(int pointerId) native;

insertAdjacentElement() ​

Element insertAdjacentElement(String where, Element element)

Inserts element into the DOM at the specified location.

To see the possible values for where, read the doc for insertAdjacentHtml.

See also:

Implementation
dart
Element insertAdjacentElement(String where, Element element) {
  if (JS('bool', '!!#.insertAdjacentElement', this)) {
    _insertAdjacentElement(where, element);
  } else {
    _insertAdjacentNode(where, element);
  }
  return element;
}

insertAdjacentHtml() ​

void insertAdjacentHtml(
  String where,
  String html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
})

Parses text as an HTML fragment and inserts it into the DOM at the specified location.

The where parameter indicates where to insert the HTML fragment:

  • 'beforeBegin': Immediately before this element.
  • 'afterBegin': As the first child of this element.
  • 'beforeEnd': As the last child of this element.
  • 'afterEnd': Immediately after this element.
dart
    var html = '<div class="something">content</div>';
    // Inserts as the first child
    document.body.insertAdjacentHtml('afterBegin', html);
    var createdElement = document.body.children[0];
    print(createdElement.classes[0]); // Prints 'something'

See also:

Implementation
dart
void insertAdjacentHtml(
  String where,
  String html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
}) {
  if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
    _insertAdjacentHtml(where, html);
  } else {
    _insertAdjacentNode(
      where,
      createFragment(
        html,
        validator: validator,
        treeSanitizer: treeSanitizer,
      ),
    );
  }
}

insertAdjacentText() ​

void insertAdjacentText(String where, String text)

Inserts text into the DOM at the specified location.

To see the possible values for where, read the doc for insertAdjacentHtml.

See also:

Implementation
dart
void insertAdjacentText(String where, String text) {
  if (JS('bool', '!!#.insertAdjacentText', this)) {
    _insertAdjacentText(where, text);
  } else {
    _insertAdjacentNode(where, new Text(text));
  }
}

insertAllBefore() inherited ​

void insertAllBefore(Iterable<Node> newNodes, Node child)

Inserts all of the nodes into this node directly before child.

See also:

Inherited from Node.

Implementation
dart
void insertAllBefore(Iterable<Node> newNodes, Node child) {
  if (newNodes is _ChildNodeListLazy) {
    _ChildNodeListLazy otherList = newNodes;
    if (identical(otherList._this, this)) {
      throw new ArgumentError(newNodes);
    }

    &#47;&#47; Optimized route for copying between nodes.
    for (var i = 0, len = otherList.length; i < len; ++i) {
      this.insertBefore(otherList._this.firstChild!, child);
    }
  } else {
    for (var node in newNodes) {
      this.insertBefore(node, child);
    }
  }
}

insertBefore() inherited ​

Node insertBefore(Node node, Node? child)

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.

Other resources ​

Inherited from Node.

Implementation
dart
Node insertBefore(Node node, Node? child) native;

deprecated leftView() ​

void leftView()

DEPRECATED

next release

Deprecated*: override detached instead.

Implementation
dart
@deprecated
void leftView() {}

matches() ​

bool matches(String selectors)

Checks if this element matches the CSS selectors.

Implementation
dart
bool matches(String selectors) {
  if (JS('bool', '!!#.matches', this)) {
    return JS('bool', '#.matches(#)', this, selectors);
  } else if (JS('bool', '!!#.webkitMatchesSelector', this)) {
    return JS('bool', '#.webkitMatchesSelector(#)', this, selectors);
  } else if (JS('bool', '!!#.mozMatchesSelector', this)) {
    return JS('bool', '#.mozMatchesSelector(#)', this, selectors);
  } else if (JS('bool', '!!#.msMatchesSelector', this)) {
    return JS('bool', '#.msMatchesSelector(#)', this, selectors);
  } else if (JS('bool', '!!#.oMatchesSelector', this)) {
    return JS('bool', '#.oMatchesSelector(#)', this, selectors);
  } else {
    throw new UnsupportedError("Not supported on this platform");
  }
}

matchesWithAncestors() ​

bool matchesWithAncestors(String selectors)

Checks if this element or any of its parents match the CSS selectors.

Implementation
dart
bool matchesWithAncestors(String selectors) {
  var elem = this as Element?;
  do {
    if (elem!.matches(selectors)) return true;
    elem = elem.parent;
  } while (elem != null);
  return false;
}

noSuchMethod() inherited ​

dynamic noSuchMethod(Invocation invocation)

Invoked when a nonexistent method or property is accessed.

A dynamic member invocation can attempt to call a member which doesn't exist on the receiving object. Example:

dart
dynamic object = 1;
object.add(42); // Statically allowed, run-time error

This invalid code will invoke the noSuchMethod method of the integer 1 with an Invocation representing the .add(42) call and arguments (which then throws).

Classes can override noSuchMethod to provide custom behavior for such invalid dynamic invocations.

A class with a non-default noSuchMethod invocation can also omit implementations for members of its interface. Example:

dart
class MockList<T> implements List<T> {
  noSuchMethod(Invocation invocation) {
    log(invocation);
    super.noSuchMethod(invocation); // Will throw.
  }
}
void main() {
  MockList().add(42);
}

This code has no compile-time warnings or errors even though the MockList class has no concrete implementation of any of the List interface methods. Calls to List methods are forwarded to noSuchMethod, so this code will log an invocation similar to Invocation.method(#add, [42]) and then throw.

If a value is returned from noSuchMethod, it becomes the result of the original invocation. If the value is not of a type that can be returned by the original invocation, a type error occurs at the invocation.

The default behavior is to throw a NoSuchMethodError.

Inherited from Interceptor.

Implementation
dart
dynamic noSuchMethod(Invocation invocation) {
  throw NoSuchMethodError.withInvocation(this, invocation);
}

offsetTo() ​

Point<num> offsetTo(Element parent)

Provides the offset of this element's borderEdge relative to the specified parent.

This is the Dart equivalent of jQuery's position method. Unlike jQuery's position, however, parent can be any parent element of this, rather than only this's immediate offsetParent. If the specified element is not an offset parent or transitive offset parent to this element, an ArgumentError is thrown.

Implementation
dart
Point offsetTo(Element parent) {
  return Element._offsetToHelper(this, parent);
}

querySelector() override ​

Element? querySelector(String selectors)

Finds the first descendant element of this element that matches the specified group of selectors.

selectors should be a string using CSS selector syntax.

dart
// Gets the first descendant with the class 'classname'
var element = element.querySelector('.className');
// Gets the element with id 'id'
var element = element.querySelector('#id');
// Gets the first descendant [ImageElement]
var img = element.querySelector('img');

For details about CSS selector syntax, see the CSS selector specification.

Implementation
dart
Element? querySelector(String selectors) native;

querySelectorAll() ​

ElementList<T> querySelectorAll<T extends Element>(String selectors)

Finds all descendent elements of this element that match the specified group of selectors.

selectors should be a string using CSS selector syntax.

dart
var items = element.querySelectorAll('.itemClassName');

For details about CSS selector syntax, see the CSS selector specification.

Implementation
dart
ElementList<T> querySelectorAll<T extends Element>(String selectors) =>
    new _FrozenElementList<T>._wrap(_querySelectorAll(selectors));

releasePointerCapture() ​

void releasePointerCapture(int pointerId)
Implementation
dart
void releasePointerCapture(int pointerId) native;

remove() inherited ​

void remove()

Removes this node from the DOM.

Inherited from Node.

Implementation
dart
void remove() {
  &#47;&#47; TODO(jacobr): should we throw an exception if parent is already null?
  &#47;&#47; TODO(vsm): Use the native remove when available.
  if (this.parentNode != null) {
    final Node parent = this.parentNode!;
    parent._removeChild(this);
  }
}

removeAttribute() ​

void removeAttribute(String name)
Implementation
dart
@pragma('dart2js:tryInline')
void removeAttribute(String name) {
  &#47;&#47; TODO(41258): Delete this assertion after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  assert(name != null, 'Attribute name cannot be null');
  _removeAttribute(name);
}

removeAttributeNS() ​

void removeAttributeNS(String? namespaceURI, String name)
Implementation
dart
@pragma('dart2js:tryInline')
void removeAttributeNS(String? namespaceURI, String name) {
  &#47;&#47; TODO(41258): Delete this assertion after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  assert(name != null, 'Attribute name cannot be null');
  _removeAttributeNS(namespaceURI, name);
}

removeEventListener() inherited ​

void removeEventListener(
  String type,
  (dynamic Function(Event event))? listener, [
  bool? useCapture,
])

Inherited from EventTarget.

Implementation
dart
void removeEventListener(
  String type,
  EventListener? listener, [
  bool? useCapture,
]) {
  &#47;&#47; TODO(leafp): This check is avoid a bug in our dispatch code when
  &#47;&#47; listener is null.  The browser treats this call as a no-op in this
  &#47;&#47; case, so it's fine to short-circuit it, but we should not have to.
  if (listener != null) {
    _removeEventListener(type, listener, useCapture);
  }
}

replaceWith() inherited ​

Node replaceWith(Node otherNode)

Replaces this node with another node.

Inherited from Node.

Implementation
dart
Node replaceWith(Node otherNode) {
  try {
    final Node parent = this.parentNode!;
    parent._replaceChild(otherNode, this);
  } catch (e) {}
  return this;
}

requestFullscreen() ​

Future<void> requestFullscreen([Map<dynamic, dynamic>? options])

Displays this element fullscreen.

Other resources ​

Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
Future<void> requestFullscreen([Map? options]) {
  var retValue;
  if (options != null) {
    retValue = JS(
      '',
      '(#.requestFullscreen||#.webkitRequestFullscreen).call(#, #)',
      this,
      this,
      this,
      convertDartToNative_Dictionary(options),
    );
  } else {
    retValue = JS(
      '',
      '(#.requestFullscreen||#.webkitRequestFullscreen).call(#)',
      this,
      this,
      this,
    );
  }
  if (retValue != null) return promiseToFuture(retValue);
  return Future<void>.value();
}

requestPointerLock() ​

void requestPointerLock()
Implementation
dart
void requestPointerLock() native;

scroll() ​

void scroll([dynamic options_OR_x, num? y])
Implementation
dart
void scroll([options_OR_x, num? y]) {
  if (options_OR_x == null && y == null) {
    _scroll_1();
    return;
  }
  if ((options_OR_x is Map) && y == null) {
    var options_1 = convertDartToNative_Dictionary(options_OR_x);
    _scroll_2(options_1);
    return;
  }
  if (y != null && (options_OR_x is num)) {
    _scroll_3(options_OR_x, y);
    return;
  }
  throw new ArgumentError("Incorrect number or type of arguments");
}

scrollBy() ​

void scrollBy([dynamic options_OR_x, num? y])
Implementation
dart
void scrollBy([options_OR_x, num? y]) {
  if (options_OR_x == null && y == null) {
    _scrollBy_1();
    return;
  }
  if ((options_OR_x is Map) && y == null) {
    var options_1 = convertDartToNative_Dictionary(options_OR_x);
    _scrollBy_2(options_1);
    return;
  }
  if (y != null && (options_OR_x is num)) {
    _scrollBy_3(options_OR_x, y);
    return;
  }
  throw new ArgumentError("Incorrect number or type of arguments");
}

scrollIntoView() ​

void scrollIntoView([ScrollAlignment? alignment])

Scrolls this element into view.

Only one of the alignment options may be specified at a time.

If no options are specified then this will attempt to scroll the minimum amount needed to bring the element into view.

Note that alignCenter is currently only supported on WebKit platforms. If alignCenter is specified but not supported then this will fall back to alignTop.

See also:

Implementation
dart
void scrollIntoView([ScrollAlignment? alignment]) {
  var hasScrollIntoViewIfNeeded = true;
  hasScrollIntoViewIfNeeded = JS(
    'bool',
    '!!(#.scrollIntoViewIfNeeded)',
    this,
  );
  if (alignment == ScrollAlignment.TOP) {
    this._scrollIntoView(true);
  } else if (alignment == ScrollAlignment.BOTTOM) {
    this._scrollIntoView(false);
  } else if (hasScrollIntoViewIfNeeded) {
    &#47;&#47; TODO(srujzs): This method shouldn't be calling out to
    &#47;&#47; `scrollIntoViewIfNeeded`. Remove this and make `scrollIntoView` match
    &#47;&#47; the browser definition. If you intend to use `scrollIntoViewIfNeeded`,
    &#47;&#47; use the `Element.scrollIntoViewIfNeeded` method.
    if (alignment == ScrollAlignment.CENTER) {
      this.scrollIntoViewIfNeeded(true);
    } else {
      this.scrollIntoViewIfNeeded();
    }
  } else {
    this._scrollIntoView();
  }
}

scrollIntoViewIfNeeded() ​

void scrollIntoViewIfNeeded([bool? centerIfNeeded])

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.

Other resources ​

Implementation
dart
void scrollIntoViewIfNeeded([bool? centerIfNeeded]) native;

scrollTo() ​

void scrollTo([dynamic options_OR_x, num? y])
Implementation
dart
void scrollTo([options_OR_x, num? y]) {
  if (options_OR_x == null && y == null) {
    _scrollTo_1();
    return;
  }
  if ((options_OR_x is Map) && y == null) {
    var options_1 = convertDartToNative_Dictionary(options_OR_x);
    _scrollTo_2(options_1);
    return;
  }
  if (y != null && (options_OR_x is num)) {
    _scrollTo_3(options_OR_x, y);
    return;
  }
  throw new ArgumentError("Incorrect number or type of arguments");
}

setApplyScroll() ​

Future<ScrollState> setApplyScroll(String nativeScrollBehavior)
Implementation
dart
Future<ScrollState> setApplyScroll(String nativeScrollBehavior) {
  var completer = new Completer<ScrollState>();
  _setApplyScroll((value) {
    completer.complete(value);
  }, nativeScrollBehavior);
  return completer.future;
}

setAttribute() ​

void setAttribute(String name, Object value)
Implementation
dart
@pragma('dart2js:tryInline')
void setAttribute(String name, Object value) {
  &#47;&#47; TODO(41258): Delete these assertions after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  assert(name != null, 'Attribute name cannot be null');
  &#47;&#47; TODO(sra): assert(value != null, 'Attribute value cannot be null.');
  _setAttribute(name, value);
}

setAttributeNS() ​

void setAttributeNS(String? namespaceURI, String name, Object value)
Implementation
dart
@pragma('dart2js:tryInline')
void setAttributeNS(String? namespaceURI, String name, Object value) {
  &#47;&#47; TODO(41258): Delete these assertions after forcing strong mode.
  &#47;&#47; Protect [name] against string conversion to "null" or "undefined".
  assert(name != null, 'Attribute name cannot be null');
  &#47;&#47; TODO(sra): assert(value != null, 'Attribute value cannot be null.');
  _setAttributeNS(namespaceURI, name, value);
}

setDistributeScroll() ​

Future<ScrollState> setDistributeScroll(String nativeScrollBehavior)
Implementation
dart
Future<ScrollState> setDistributeScroll(String nativeScrollBehavior) {
  var completer = new Completer<ScrollState>();
  _setDistributeScroll((value) {
    completer.complete(value);
  }, nativeScrollBehavior);
  return completer.future;
}

setInnerHtml() ​

void setInnerHtml(
  String? html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
})

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.

If the default validation behavior is too restrictive then a new NodeValidator should be created, either extending or wrapping a default validator and overriding the validation APIs.

The treeSanitizer is used to walk the generated node tree and sanitize it. A custom treeSanitizer can also be provided to perform special validation rules but since the API is more complex to implement this is discouraged.

The resulting tree is guaranteed to only contain nodes and attributes which are allowed by the provided validator.

See also:

Implementation
dart
void setInnerHtml(
  String? html, {
  NodeValidator? validator,
  NodeTreeSanitizer? treeSanitizer,
}) {
  text = null;
  if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
    _innerHtml = html;
  } else {
    append(
      createFragment(
        html,
        validator: validator,
        treeSanitizer: treeSanitizer,
      ),
    );
  }
}

setPointerCapture() ​

void setPointerCapture(int pointerId)
Implementation
dart
void setPointerCapture(int pointerId) native;

toString() override ​

String toString()

The string representation of this element.

This is equivalent to reading the localName property.

Implementation
dart
String toString() => localName;

Operators ​

operator ==() inherited ​

bool operator ==(Object other)

The equality operator.

The default behavior for all Objects is to return true if and only if this object and other are the same object.

Override this method to specify a different equality relation on a class. The overriding method must still be an equivalence relation. That is, it must be:

  • Total: It must return a boolean for all arguments. It should never throw.

  • Reflexive: For all objects o, o == o must be true.

  • Symmetric: For all objects o1 and o2, o1 == o2 and o2 == o1 must either both be true, or both be false.

  • Transitive: For all objects o1, o2, and o3, if o1 == o2 and o2 == o3 are true, then o1 == o3 must be true.

The method should also be consistent over time, so whether two objects are equal should only change if at least one of the objects was modified.

If a subclass overrides the equality operator, it should override the hashCode method as well to maintain consistency.

Inherited from Interceptor.

Implementation
dart
bool operator ==(Object other) => identical(this, other);

Static Methods ​

isTagSupported() ​

bool isTagSupported(String tag)

Checks to see if the tag name is supported by the current platform.

The tag should be a valid HTML tag name.

Implementation
dart
static bool isTagSupported(String tag) {
  var e = _ElementFactoryProvider.createElement_tag(tag, null);
  return e is Element && !(e is UnknownElement);
}

Constants ​

abortEvent ​

const EventStreamProvider<Event> abortEvent

Static factory designed to expose abort events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> abortEvent =
    const EventStreamProvider<Event>('abort');

beforeCopyEvent ​

const EventStreamProvider<Event> beforeCopyEvent

Static factory designed to expose beforecopy events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> beforeCopyEvent =
    const EventStreamProvider<Event>('beforecopy');

beforeCutEvent ​

const EventStreamProvider<Event> beforeCutEvent

Static factory designed to expose beforecut events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> beforeCutEvent =
    const EventStreamProvider<Event>('beforecut');

beforePasteEvent ​

const EventStreamProvider<Event> beforePasteEvent

Static factory designed to expose beforepaste events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> beforePasteEvent =
    const EventStreamProvider<Event>('beforepaste');

blurEvent ​

const EventStreamProvider<Event> blurEvent

Static factory designed to expose blur events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> blurEvent =
    const EventStreamProvider<Event>('blur');

canPlayEvent ​

const EventStreamProvider<Event> canPlayEvent
Implementation
dart
static const EventStreamProvider<Event> canPlayEvent =
    const EventStreamProvider<Event>('canplay');

canPlayThroughEvent ​

const EventStreamProvider<Event> canPlayThroughEvent
Implementation
dart
static const EventStreamProvider<Event> canPlayThroughEvent =
    const EventStreamProvider<Event>('canplaythrough');

changeEvent ​

const EventStreamProvider<Event> changeEvent

Static factory designed to expose change events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> changeEvent =
    const EventStreamProvider<Event>('change');

clickEvent ​

Static factory designed to expose click events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> clickEvent =
    const EventStreamProvider<MouseEvent>('click');

contextMenuEvent ​

const EventStreamProvider<MouseEvent> contextMenuEvent

Static factory designed to expose contextmenu events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> contextMenuEvent =
    const EventStreamProvider<MouseEvent>('contextmenu');

copyEvent ​

Static factory designed to expose copy events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<ClipboardEvent> copyEvent =
    const EventStreamProvider<ClipboardEvent>('copy');

cutEvent ​

Static factory designed to expose cut events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<ClipboardEvent> cutEvent =
    const EventStreamProvider<ClipboardEvent>('cut');

doubleClickEvent ​

const EventStreamProvider<Event> doubleClickEvent

Static factory designed to expose doubleclick events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
@DomName('Element.dblclickEvent')
static const EventStreamProvider<Event> doubleClickEvent =
    const EventStreamProvider<Event>('dblclick');

dragEndEvent ​

const EventStreamProvider<MouseEvent> dragEndEvent

A stream of dragend events fired when an element completes a drag operation.

Other resources ​

Implementation
dart
static const EventStreamProvider<MouseEvent> dragEndEvent =
    const EventStreamProvider<MouseEvent>('dragend');

dragEnterEvent ​

const EventStreamProvider<MouseEvent> dragEnterEvent

A stream of dragenter events fired when a dragged object is first dragged over an element.

Other resources ​

Implementation
dart
static const EventStreamProvider<MouseEvent> dragEnterEvent =
    const EventStreamProvider<MouseEvent>('dragenter');

dragEvent ​

A stream of drag events fired when an element is currently being dragged.

A drag event is added to this stream as soon as the drag begins. A drag event is also added to this stream at intervals while the drag operation is still ongoing.

Other resources ​

Implementation
dart
static const EventStreamProvider<MouseEvent> dragEvent =
    const EventStreamProvider<MouseEvent>('drag');

dragLeaveEvent ​

const EventStreamProvider<MouseEvent> dragLeaveEvent

A stream of dragleave events fired when an object being dragged over an element leaves the element's target area.

Other resources ​

Implementation
dart
static const EventStreamProvider<MouseEvent> dragLeaveEvent =
    const EventStreamProvider<MouseEvent>('dragleave');

dragOverEvent ​

const EventStreamProvider<MouseEvent> dragOverEvent

A stream of dragover events fired when a dragged object is currently being dragged over an element.

Other resources ​

Implementation
dart
static const EventStreamProvider<MouseEvent> dragOverEvent =
    const EventStreamProvider<MouseEvent>('dragover');

dragStartEvent ​

const EventStreamProvider<MouseEvent> dragStartEvent

A stream of dragstart events for a dragged element whose drag has begun.

Other resources ​

Implementation
dart
static const EventStreamProvider<MouseEvent> dragStartEvent =
    const EventStreamProvider<MouseEvent>('dragstart');

dropEvent ​

A stream of drop events fired when a dragged object is dropped on an element.

Other resources ​

Implementation
dart
static const EventStreamProvider<MouseEvent> dropEvent =
    const EventStreamProvider<MouseEvent>('drop');

durationChangeEvent ​

const EventStreamProvider<Event> durationChangeEvent
Implementation
dart
static const EventStreamProvider<Event> durationChangeEvent =
    const EventStreamProvider<Event>('durationchange');

emptiedEvent ​

const EventStreamProvider<Event> emptiedEvent
Implementation
dart
static const EventStreamProvider<Event> emptiedEvent =
    const EventStreamProvider<Event>('emptied');

endedEvent ​

const EventStreamProvider<Event> endedEvent
Implementation
dart
static const EventStreamProvider<Event> endedEvent =
    const EventStreamProvider<Event>('ended');

errorEvent ​

const EventStreamProvider<Event> errorEvent

Static factory designed to expose error events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> errorEvent =
    const EventStreamProvider<Event>('error');

focusEvent ​

const EventStreamProvider<Event> focusEvent

Static factory designed to expose focus events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> focusEvent =
    const EventStreamProvider<Event>('focus');

fullscreenChangeEvent ​

const EventStreamProvider<Event> fullscreenChangeEvent

Static factory designed to expose fullscreenchange events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
static const EventStreamProvider<Event> fullscreenChangeEvent =
    const EventStreamProvider<Event>('webkitfullscreenchange');

fullscreenErrorEvent ​

const EventStreamProvider<Event> fullscreenErrorEvent

Static factory designed to expose fullscreenerror events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
static const EventStreamProvider<Event> fullscreenErrorEvent =
    const EventStreamProvider<Event>('webkitfullscreenerror');

inputEvent ​

const EventStreamProvider<Event> inputEvent

Static factory designed to expose input events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> inputEvent =
    const EventStreamProvider<Event>('input');

invalidEvent ​

const EventStreamProvider<Event> invalidEvent

Static factory designed to expose invalid events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> invalidEvent =
    const EventStreamProvider<Event>('invalid');

keyDownEvent ​

Static factory designed to expose keydown events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<KeyboardEvent> keyDownEvent =
    const EventStreamProvider<KeyboardEvent>('keydown');

keyPressEvent ​

const EventStreamProvider<KeyboardEvent> keyPressEvent

Static factory designed to expose keypress events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<KeyboardEvent> keyPressEvent =
    const EventStreamProvider<KeyboardEvent>('keypress');

keyUpEvent ​

Static factory designed to expose keyup events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<KeyboardEvent> keyUpEvent =
    const EventStreamProvider<KeyboardEvent>('keyup');

loadedDataEvent ​

const EventStreamProvider<Event> loadedDataEvent
Implementation
dart
static const EventStreamProvider<Event> loadedDataEvent =
    const EventStreamProvider<Event>('loadeddata');

loadedMetadataEvent ​

const EventStreamProvider<Event> loadedMetadataEvent
Implementation
dart
static const EventStreamProvider<Event> loadedMetadataEvent =
    const EventStreamProvider<Event>('loadedmetadata');

loadEvent ​

const EventStreamProvider<Event> loadEvent

Static factory designed to expose load events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> loadEvent =
    const EventStreamProvider<Event>('load');

mouseDownEvent ​

const EventStreamProvider<MouseEvent> mouseDownEvent

Static factory designed to expose mousedown events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> mouseDownEvent =
    const EventStreamProvider<MouseEvent>('mousedown');

mouseEnterEvent ​

const EventStreamProvider<MouseEvent> mouseEnterEvent

Static factory designed to expose mouseenter events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> mouseEnterEvent =
    const EventStreamProvider<MouseEvent>('mouseenter');

mouseLeaveEvent ​

const EventStreamProvider<MouseEvent> mouseLeaveEvent

Static factory designed to expose mouseleave events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> mouseLeaveEvent =
    const EventStreamProvider<MouseEvent>('mouseleave');

mouseMoveEvent ​

const EventStreamProvider<MouseEvent> mouseMoveEvent

Static factory designed to expose mousemove events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> mouseMoveEvent =
    const EventStreamProvider<MouseEvent>('mousemove');

mouseOutEvent ​

const EventStreamProvider<MouseEvent> mouseOutEvent

Static factory designed to expose mouseout events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> mouseOutEvent =
    const EventStreamProvider<MouseEvent>('mouseout');

mouseOverEvent ​

const EventStreamProvider<MouseEvent> mouseOverEvent

Static factory designed to expose mouseover events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> mouseOverEvent =
    const EventStreamProvider<MouseEvent>('mouseover');

mouseUpEvent ​

const EventStreamProvider<MouseEvent> mouseUpEvent

Static factory designed to expose mouseup events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<MouseEvent> mouseUpEvent =
    const EventStreamProvider<MouseEvent>('mouseup');

mouseWheelEvent ​

const EventStreamProvider<WheelEvent> mouseWheelEvent

Static factory designed to expose mousewheel events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<WheelEvent> mouseWheelEvent =
    const _CustomEventStreamProvider<WheelEvent>(
      Element._determineMouseWheelEventType,
    );

pasteEvent ​

Static factory designed to expose paste events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<ClipboardEvent> pasteEvent =
    const EventStreamProvider<ClipboardEvent>('paste');

pauseEvent ​

const EventStreamProvider<Event> pauseEvent
Implementation
dart
static const EventStreamProvider<Event> pauseEvent =
    const EventStreamProvider<Event>('pause');

playEvent ​

const EventStreamProvider<Event> playEvent
Implementation
dart
static const EventStreamProvider<Event> playEvent =
    const EventStreamProvider<Event>('play');

playingEvent ​

const EventStreamProvider<Event> playingEvent
Implementation
dart
static const EventStreamProvider<Event> playingEvent =
    const EventStreamProvider<Event>('playing');

rateChangeEvent ​

const EventStreamProvider<Event> rateChangeEvent
Implementation
dart
static const EventStreamProvider<Event> rateChangeEvent =
    const EventStreamProvider<Event>('ratechange');

resetEvent ​

const EventStreamProvider<Event> resetEvent

Static factory designed to expose reset events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> resetEvent =
    const EventStreamProvider<Event>('reset');

resizeEvent ​

const EventStreamProvider<Event> resizeEvent
Implementation
dart
static const EventStreamProvider<Event> resizeEvent =
    const EventStreamProvider<Event>('resize');

scrollEvent ​

const EventStreamProvider<Event> scrollEvent

Static factory designed to expose scroll events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> scrollEvent =
    const EventStreamProvider<Event>('scroll');

searchEvent ​

const EventStreamProvider<Event> searchEvent

Static factory designed to expose search events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> searchEvent =
    const EventStreamProvider<Event>('search');

seekedEvent ​

const EventStreamProvider<Event> seekedEvent
Implementation
dart
static const EventStreamProvider<Event> seekedEvent =
    const EventStreamProvider<Event>('seeked');

seekingEvent ​

const EventStreamProvider<Event> seekingEvent
Implementation
dart
static const EventStreamProvider<Event> seekingEvent =
    const EventStreamProvider<Event>('seeking');

selectEvent ​

const EventStreamProvider<Event> selectEvent

Static factory designed to expose select events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> selectEvent =
    const EventStreamProvider<Event>('select');

selectStartEvent ​

const EventStreamProvider<Event> selectStartEvent

Static factory designed to expose selectstart events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> selectStartEvent =
    const EventStreamProvider<Event>('selectstart');

stalledEvent ​

const EventStreamProvider<Event> stalledEvent
Implementation
dart
static const EventStreamProvider<Event> stalledEvent =
    const EventStreamProvider<Event>('stalled');

submitEvent ​

const EventStreamProvider<Event> submitEvent

Static factory designed to expose submit events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<Event> submitEvent =
    const EventStreamProvider<Event>('submit');

suspendEvent ​

const EventStreamProvider<Event> suspendEvent
Implementation
dart
static const EventStreamProvider<Event> suspendEvent =
    const EventStreamProvider<Event>('suspend');

timeUpdateEvent ​

const EventStreamProvider<Event> timeUpdateEvent
Implementation
dart
static const EventStreamProvider<Event> timeUpdateEvent =
    const EventStreamProvider<Event>('timeupdate');

touchCancelEvent ​

const EventStreamProvider<TouchEvent> touchCancelEvent

Static factory designed to expose touchcancel events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<TouchEvent> touchCancelEvent =
    const EventStreamProvider<TouchEvent>('touchcancel');

touchEndEvent ​

const EventStreamProvider<TouchEvent> touchEndEvent

Static factory designed to expose touchend events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<TouchEvent> touchEndEvent =
    const EventStreamProvider<TouchEvent>('touchend');

touchEnterEvent ​

const EventStreamProvider<TouchEvent> touchEnterEvent

Static factory designed to expose touchenter events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<TouchEvent> touchEnterEvent =
    const EventStreamProvider<TouchEvent>('touchenter');

touchLeaveEvent ​

const EventStreamProvider<TouchEvent> touchLeaveEvent

Static factory designed to expose touchleave events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<TouchEvent> touchLeaveEvent =
    const EventStreamProvider<TouchEvent>('touchleave');

touchMoveEvent ​

const EventStreamProvider<TouchEvent> touchMoveEvent

Static factory designed to expose touchmove events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<TouchEvent> touchMoveEvent =
    const EventStreamProvider<TouchEvent>('touchmove');

touchStartEvent ​

const EventStreamProvider<TouchEvent> touchStartEvent

Static factory designed to expose touchstart events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<TouchEvent> touchStartEvent =
    const EventStreamProvider<TouchEvent>('touchstart');

transitionEndEvent ​

const EventStreamProvider<TransitionEvent> transitionEndEvent

Static factory designed to expose transitionend events to event handlers that are not necessarily instances of Element.

See EventStreamProvider for usage information.

Implementation
dart
static const EventStreamProvider<TransitionEvent> transitionEndEvent =
    const _CustomEventStreamProvider<TransitionEvent>(
      Element._determineTransitionEventType,
    );

volumeChangeEvent ​

const EventStreamProvider<Event> volumeChangeEvent
Implementation
dart
static const EventStreamProvider<Event> volumeChangeEvent =
    const EventStreamProvider<Event>('volumechange');

waitingEvent ​

const EventStreamProvider<Event> waitingEvent
Implementation
dart
static const EventStreamProvider<Event> waitingEvent =
    const EventStreamProvider<Event>('waiting');

wheelEvent ​

Implementation
dart
static const EventStreamProvider<WheelEvent> wheelEvent =
    const EventStreamProvider<WheelEvent>('wheel');