Dart API Reference
dart:html
HtmlElement
HtmlElement
class
Annotations
DocsEditable()
DomName('HTMLElement')
Extends
Object
EventTarget
Node
Element
HtmlElement
Implements
GlobalEventHandlers
Implemented by
AnchorElement
AreaElement
BaseElement
BodyElement
BRElement
ButtonElement
CanvasElement
ContentElement
DataListElement
DetailsElement
DialogElement
DivElement
DListElement
EmbedElement
FieldSetElement
FormElement
HeadElement
HeadingElement
HRElement
HtmlHtmlElement
IFrameElement
ImageElement
InputElement
KeygenElement
LabelElement
LegendElement
LIElement
LinkElement
MapElement
MediaElement
MenuElement
MenuItemElement
MetaElement
MeterElement
ModElement
ObjectElement
OListElement
OptGroupElement
OptionElement
OutputElement
ParagraphElement
ParamElement
PictureElement
PreElement
ProgressElement
QuoteElement
ScriptElement
SelectElement
ShadowElement
SourceElement
SpanElement
StyleElement
TableCaptionElement
TableCellElement
TableColElement
TableElement
TableRowElement
TableSectionElement
TemplateElement
TextAreaElement
TitleElement
TrackElement
UListElement
UnknownElement
Constructors
HtmlElement.created
()
Constructor instantiated by the DOM when a custom element has been created.
Constants
abortEvent
=
const
EventStreamProvider
<
Event
>
('abort')
blurEvent
=
const
EventStreamProvider
<
Event
>
('blur')
canPlayEvent
=
const
EventStreamProvider
<
Event
>
('canplay')
canPlayThroughEvent
=
const
EventStreamProvider
<
Event
>
('canplaythrough')
changeEvent
=
const
EventStreamProvider
<
Event
>
('change')
clickEvent
=
const
EventStreamProvider
<
MouseEvent
>
('click')
contextMenuEvent
=
const
EventStreamProvider
<
MouseEvent
>
('contextmenu')
doubleClickEvent
=
const
EventStreamProvider
<
Event
>
('dblclick')
dragEvent
=
const
EventStreamProvider
<
MouseEvent
>
('drag')
dragEndEvent
=
const
EventStreamProvider
<
MouseEvent
>
('dragend')
dragEnterEvent
=
const
EventStreamProvider
<
MouseEvent
>
('dragenter')
dragLeaveEvent
=
const
EventStreamProvider
<
MouseEvent
>
('dragleave')
dragOverEvent
=
const
EventStreamProvider
<
MouseEvent
>
('dragover')
dragStartEvent
=
const
EventStreamProvider
<
MouseEvent
>
('dragstart')
dropEvent
=
const
EventStreamProvider
<
MouseEvent
>
('drop')
durationChangeEvent
=
const
EventStreamProvider
<
Event
>
('durationchange')
emptiedEvent
=
const
EventStreamProvider
<
Event
>
('emptied')
endedEvent
=
const
EventStreamProvider
<
Event
>
('ended')
errorEvent
=
const
EventStreamProvider
<
Event
>
('error')
focusEvent
=
const
EventStreamProvider
<
Event
>
('focus')
inputEvent
=
const
EventStreamProvider
<
Event
>
('input')
invalidEvent
=
const
EventStreamProvider
<
Event
>
('invalid')
keyDownEvent
=
const
EventStreamProvider
<
KeyboardEvent
>
('keydown')
keyPressEvent
=
const
EventStreamProvider
<
KeyboardEvent
>
('keypress')
keyUpEvent
=
const
EventStreamProvider
<
KeyboardEvent
>
('keyup')
loadEvent
=
const
EventStreamProvider
<
Event
>
('load')
loadedDataEvent
=
const
EventStreamProvider
<
Event
>
('loadeddata')
loadedMetadataEvent
=
const
EventStreamProvider
<
Event
>
('loadedmetadata')
mouseDownEvent
=
const
EventStreamProvider
<
MouseEvent
>
('mousedown')
mouseEnterEvent
=
const
EventStreamProvider
<
MouseEvent
>
('mouseenter')
mouseLeaveEvent
=
const
EventStreamProvider
<
MouseEvent
>
('mouseleave')
mouseMoveEvent
=
const
EventStreamProvider
<
MouseEvent
>
('mousemove')
mouseOutEvent
=
const
EventStreamProvider
<
MouseEvent
>
('mouseout')
mouseOverEvent
=
const
EventStreamProvider
<
MouseEvent
>
('mouseover')
mouseUpEvent
=
const
EventStreamProvider
<
MouseEvent
>
('mouseup')
mouseWheelEvent
=
const
EventStreamProvider
<
WheelEvent
>
('mousewheel')
pauseEvent
=
const
EventStreamProvider
<
Event
>
('pause')
playEvent
=
const
EventStreamProvider
<
Event
>
('play')
playingEvent
=
const
EventStreamProvider
<
Event
>
('playing')
rateChangeEvent
=
const
EventStreamProvider
<
Event
>
('ratechange')
resetEvent
=
const
EventStreamProvider
<
Event
>
('reset')
resizeEvent
=
const
EventStreamProvider
<
Event
>
('resize')
scrollEvent
=
const
EventStreamProvider
<
Event
>
('scroll')
seekedEvent
=
const
EventStreamProvider
<
Event
>
('seeked')
seekingEvent
=
const
EventStreamProvider
<
Event
>
('seeking')
selectEvent
=
const
EventStreamProvider
<
Event
>
('select')
stalledEvent
=
const
EventStreamProvider
<
Event
>
('stalled')
submitEvent
=
const
EventStreamProvider
<
Event
>
('submit')
suspendEvent
=
const
EventStreamProvider
<
Event
>
('suspend')
timeUpdateEvent
=
const
EventStreamProvider
<
Event
>
('timeupdate')
volumeChangeEvent
=
const
EventStreamProvider
<
Event
>
('volumechange')
waitingEvent
=
const
EventStreamProvider
<
Event
>
('waiting')
Instance Properties
contentEditable
String
read / write
contextMenu
MenuElement
read / write
dir
String
read / write
draggable
bool
read / write
hidden
bool
read / write
inputMethodContext
InputMethodContext
read-only
isContentEditable
bool
read-only
lang
String
read / write
spellcheck
bool
read / write
tabIndex
int
read / write
title
String
read / write
translate
bool
read / write
dropzone
String
read / write
onAbort
ElementStream
<
Event
>
read-only
onBlur
ElementStream
<
Event
>
read-only
onCanPlay
ElementStream
<
Event
>
read-only
onCanPlayThrough
ElementStream
<
Event
>
read-only
onChange
ElementStream
<
Event
>
read-only
onClick
ElementStream
<
MouseEvent
>
read-only
onContextMenu
ElementStream
<
MouseEvent
>
read-only
onDoubleClick
ElementStream
<
Event
>
read-only
onDrag
ElementStream
<
MouseEvent
>
read-only
onDragEnd
ElementStream
<
MouseEvent
>
read-only
onDragEnter
ElementStream
<
MouseEvent
>
read-only
onDragLeave
ElementStream
<
MouseEvent
>
read-only
onDragOver
ElementStream
<
MouseEvent
>
read-only
onDragStart
ElementStream
<
MouseEvent
>
read-only
onDrop
ElementStream
<
MouseEvent
>
read-only
onDurationChange
ElementStream
<
Event
>
read-only
onEmptied
ElementStream
<
Event
>
read-only
onEnded
ElementStream
<
Event
>
read-only
onError
ElementStream
<
Event
>
read-only
onFocus
ElementStream
<
Event
>
read-only
onInput
ElementStream
<
Event
>
read-only
onInvalid
ElementStream
<
Event
>
read-only
onKeyDown
ElementStream
<
KeyboardEvent
>
read-only
onKeyPress
ElementStream
<
KeyboardEvent
>
read-only
onKeyUp
ElementStream
<
KeyboardEvent
>
read-only
onLoad
ElementStream
<
Event
>
read-only
onLoadedData
ElementStream
<
Event
>
read-only
onLoadedMetadata
ElementStream
<
Event
>
read-only
onMouseDown
ElementStream
<
MouseEvent
>
read-only
onMouseEnter
ElementStream
<
MouseEvent
>
read-only
onMouseLeave
ElementStream
<
MouseEvent
>
read-only
onMouseMove
ElementStream
<
MouseEvent
>
read-only
onMouseOut
ElementStream
<
MouseEvent
>
read-only
onMouseOver
ElementStream
<
MouseEvent
>
read-only
onMouseUp
ElementStream
<
MouseEvent
>
read-only
onMouseWheel
ElementStream
<
WheelEvent
>
read-only
onPause
ElementStream
<
Event
>
read-only
onPlay
ElementStream
<
Event
>
read-only
onPlaying
ElementStream
<
Event
>
read-only
onRateChange
ElementStream
<
Event
>
read-only
onReset
ElementStream
<
Event
>
read-only
onResize
ElementStream
<
Event
>
read-only
onScroll
ElementStream
<
Event
>
read-only
onSeeked
ElementStream
<
Event
>
read-only
onSeeking
ElementStream
<
Event
>
read-only
onSelect
ElementStream
<
Event
>
read-only
onStalled
ElementStream
<
Event
>
read-only
onSubmit
ElementStream
<
Event
>
read-only
onSuspend
ElementStream
<
Event
>
read-only
onTimeUpdate
ElementStream
<
Event
>
read-only
onVolumeChange
ElementStream
<
Event
>
read-only
onWaiting
ElementStream
<
Event
>
read-only
on
ElementEvents
Inherited
read-only
nodes
List
<
Node
>
Inherited
read / write
baseUri
String
Inherited
read-only
childNodes
List
<
Node
>
Inherited
read-only
firstChild
Node
Inherited
read-only
lastChild
Node
Inherited
read-only
nextNode
Node
Inherited
read-only
nodeName
String
Inherited
read-only
nodeType
int
Inherited
read-only
nodeValue
String
Inherited
read-only
ownerDocument
Document
Inherited
read-only
parent
Element
Inherited
read-only
parentNode
Node
Inherited
read-only
previousNode
Node
Inherited
read-only
text
String
Inherited
read / write
contentEditable
String
Inherited
read / write
contextMenu
MenuElement
Inherited
read / write
dir
String
Inherited
read / write
draggable
bool
Inherited
read / write
hidden
bool
Inherited
read / write
lang
String
Inherited
read / write
spellcheck
bool
Inherited
read / write
tabIndex
int
Inherited
read / write
title
String
Inherited
read / write
translate
bool
Inherited
read / write
dropzone
String
Inherited
read / write
attributes
Map
<
String
,
String
>
Inherited
read / write
children
List
<
Element
>
Inherited
read / write
classes
CssClassSet
Inherited
read / write
dataset
Map
<
String
,
String
>
Inherited
read / write
client
Rectangle
Inherited
read-only
offset
Rectangle
Inherited
read-only
xtag
dynamic
Inherited
read / write
localName
String
Inherited
read-only
namespaceUri
String
Inherited
read-only
contentEdge
CssRect
Inherited
read-only
paddingEdge
CssRect
Inherited
read-only
borderEdge
CssRect
Inherited
read-only
marginEdge
CssRect
Inherited
read-only
documentOffset
Point
Inherited
read-only
innerHtml
String
Inherited
read / write
offsetHeight
int
Inherited
read-only
offsetLeft
int
Inherited
read-only
offsetTop
int
Inherited
read-only
offsetWidth
int
Inherited
read-only
clientHeight
int
Inherited
read-only
clientLeft
int
Inherited
read-only
clientTop
int
Inherited
read-only
clientWidth
int
Inherited
read-only
scrollHeight
int
Inherited
read-only
scrollLeft
int
Inherited
read / write
scrollTop
int
Inherited
read / write
scrollWidth
int
Inherited
read-only
className
String
Inherited
read / write
id
String
Inherited
read / write
offsetParent
Element
Inherited
read-only
outerHtml
String
Inherited
read-only
shadowRoot
ShadowRoot
Inherited
read-only
style
CssStyleDeclaration
Inherited
read-only
tagName
String
Inherited
read-only
nextElementSibling
Element
Inherited
read-only
previousElementSibling
Element
Inherited
read-only
onBeforeCopy
ElementStream
<
Event
>
Inherited
read-only
onBeforeCut
ElementStream
<
Event
>
Inherited
read-only
onBeforePaste
ElementStream
<
Event
>
Inherited
read-only
onCopy
ElementStream
<
Event
>
Inherited
read-only
onCut
ElementStream
<
Event
>
Inherited
read-only
onPaste
ElementStream
<
Event
>
Inherited
read-only
onSearch
ElementStream
<
Event
>
Inherited
read-only
onSelectStart
ElementStream
<
Event
>
Inherited
read-only
onTouchCancel
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchEnd
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchEnter
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchLeave
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchMove
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchStart
ElementStream
<
TouchEvent
>
Inherited
read-only
onTransitionEnd
ElementStream
<
TransitionEvent
>
Inherited
read-only
onFullscreenChange
ElementStream
<
Event
>
Inherited
read-only
onFullscreenError
ElementStream
<
Event
>
Inherited
read-only
Instance Methods
click
(
) →
void
toString
(
) →
String
Inherited
The string representation of this element.
addEventListener
(
String
type
,
dynamic
listener
(
Event
event
)
, [
bool
useCapture
]) →
void
Inherited
removeEventListener
(
String
type
,
dynamic
listener
(
Event
event
)
, [
bool
useCapture
]) →
void
Inherited
dispatchEvent
(
Event
event
) →
bool
Inherited
remove
(
) →
void
Inherited
Removes this node from the DOM.
replaceWith
(
Node
otherNode
) →
Node
Inherited
Replaces this node with another node.
insertAllBefore
(
Iterable
<
Node
>
newNodes
,
Node
refChild
) →
Node
Inherited
Inserts all of the nodes into this node directly before refChild.
append
(
Node
newChild
) →
Node
Inherited
Adds a node to the end of the child
nodes
list of this node.
clone
(
bool
deep
) →
Node
Inherited
Returns a copy of this node.
contains
(
Node
other
) →
bool
Inherited
Returns true if this node contains the specified node.
hasChildNodes
(
) →
bool
Inherited
Returns true if this node has any children.
insertBefore
(
Node
newChild
,
Node
refChild
) →
Node
Inherited
Inserts all of the nodes into this node directly before refChild.
querySelectorAll
(
String
selectors
) →
ElementList
<
Element
>
Inherited
Finds all descendent elements of this element that match the specified group of selectors.
query
(
String
relativeSelectors
) →
Element
Inherited
Alias for
querySelector
. Note this function is deprecated because its semantics will be changing in the future.
queryAll
(
String
relativeSelectors
) →
ElementList
<
Element
>
Inherited
Alias for
querySelectorAll
. Note this function is deprecated because its semantics will be changing in the future.
getNamespacedAttributes
(
String
namespace
) →
Map
<
String
,
String
>
Inherited
Gets a map for manipulating the attributes of a particular namespace.
getComputedStyle
(
[
String
pseudoElement
]) →
CssStyleDeclaration
Inherited
The set of all CSS values applied to this element, including inherited and default values.
appendText
(
String
text
) →
void
Inherited
Adds the specified text after the last child of this element.
appendHtml
(
String
text
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
}) →
void
Inherited
Parses the specified text as HTML and adds the resulting node after the last child of this element.
attached
(
) →
void
Inherited
Called by the DOM when this element has been inserted into the live document.
detached
(
) →
void
Inherited
Called by the DOM when this element has been removed from the live document.
enteredView
(
) →
void
Inherited
Deprecated*: override
attached
instead.
leftView
(
) →
void
Inherited
Deprecated*: override
detached
instead.
attributeChanged
(
String
name
,
String
oldValue
,
String
newValue
) →
void
Inherited
Called by the DOM whenever an attribute on this has been changed.
scrollIntoView
(
[
ScrollAlignment
alignment
]) →
void
Inherited
Scrolls this element into view.
insertAdjacentHtml
(
String
where
,
String
html
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
}) →
void
Inherited
Parses text as an HTML fragment and inserts it into the DOM at the specified location.
matchesWithAncestors
(
String
selectors
) →
bool
Inherited
Checks if this element or any of its parents match the CSS selectors.
offsetTo
(
Element
parent
) →
Point
Inherited
Provides the offset of this element's
borderEdge
relative to the specified parent.
createFragment
(
String
html
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
}) →
DocumentFragment
Inherited
Create a DocumentFragment from the HTML fragment and ensure that it follows the sanitization rules specified by the validator or treeSanitizer.
setInnerHtml
(
String
html
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
}) →
void
Inherited
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.
animate
(
Object
effect
, [
Object
timing
]) →
AnimationPlayer
Inherited
blur
(
) →
void
Inherited
createShadowRoot
(
) →
ShadowRoot
Inherited
focus
(
) →
void
Inherited
getAnimationPlayers
(
) →
List
<
AnimationPlayer
>
Inherited
getAttribute
(
String
name
) →
String
Inherited
getAttributeNS
(
String
namespaceURI
,
String
localName
) →
String
Inherited
getBoundingClientRect
(
) →
Rectangle
Inherited
Returns the smallest bounding rectangle that encompasses this element's padding, scrollbar, and border.
getClientRects
(
) →
List
<
Rectangle
>
Inherited
Returns a list of bounding rectangles for each box associated with this element.
getDestinationInsertionPoints
(
) →
List
<
Node
>
Inherited
Returns a list of shadow DOM insertion points to which this element is distributed.
getElementsByClassName
(
String
classNames
) →
List
<
Node
>
Inherited
Returns a list of nodes with the given class name inside this element.
insertAdjacentElement
(
String
where
,
Element
element
) →
Element
Inherited
insertAdjacentText
(
String
where
,
String
text
) →
void
Inherited
matches
(
String
selectors
) →
bool
Inherited
requestFullscreen
(
) →
void
Inherited
requestPointerLock
(
) →
void
Inherited
setAttribute
(
String
name
,
String
value
) →
void
Inherited
setAttributeNS
(
String
namespaceURI
,
String
qualifiedName
,
String
value
) →
void
Inherited
querySelector
(
String
selectors
) →
Element
Inherited
Finds the first descendant element of this element that matches the specified group of selectors.