Element class

Inheritance

Constructors

Element.html(String html)
factory
Element.tag(String localName)

Properties

attributes LinkedHashMap<dynamic, String>
A map holding name, value pairs for attributes of the node. [...]
read / write, inherited
attributeSpans LinkedHashMap<dynamic, FileSpan>
If sourceSpan is available, this contains the spans of each attribute. The span of an attribute is the entire attribute, including the name and quotes (if any). For example, the span of "attr" in <a attr="value"> would be the text attr="value".
read-only, inherited
attributeValueSpans LinkedHashMap<dynamic, FileSpan>
If sourceSpan is available, this contains the spans of each attribute's value. Unlike attributeSpans, this span will inlcude only the value. For example, the value span of "attr" in <a attr="value"> would be the text value.
read-only, inherited
children List<Element>
read-only, inherited
classes CssClassSet
The set of CSS classes applied to this element. [...]
read-only
className String
read / write
endSourceSpan FileSpan
The source span of the end tag this element, if it was created by the HtmlParser. May be null if does not have an implicit end tag.
read / write
firstChild Node
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
read / write
innerHtml String
Returns a fragment of HTML or XML that represents the element's contents. Can be set, to replace the contents of the element with nodes parsed from the given string.
read / write
localName String
The local name of this element.
final
namespaceUri String
final
nextElementSibling Element
read-only
nodes NodeList
A list of child nodes of the current node. This must include all elements but not necessarily other node types.
final, inherited
nodeType int
read-only, override
outerHtml String
Returns a fragment of HTML or XML that represents the element and its contents.
read-only
parent Element
The parent element of this node. [...]
read-only, inherited
parentNode Node
The parent of the current node (or null for the document node).
read / write, inherited
previousElementSibling Element
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sourceSpan FileSpan
The source span of this node, if it was created by the HtmlParser.
read / write, inherited
text String
read / write, override

Methods

append(Node node) → void
inherited
clone(bool deep) Element
Returns a copy of this node. [...]
override
contains(Node node) bool
inherited
getElementsByClassName(String classNames) List<Element>
inherited
getElementsByTagName(String localName) List<Element>
inherited
hasChildNodes() bool
inherited
hasContent() bool
Return true if the node has children or text.
inherited
insertBefore(Node node, Node refNode) → void
Insert node as a child of the current node, before refNode in the list of child nodes. Raises UnsupportedOperationException if refNode is not a child of the current node. If refNode is null, this adds to the end of the list.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
querySelector(String selector) Element
Seaches for the first descendant node matching the given selectors, using a preorder traversal. [...]
inherited
querySelectorAll(String selector) List<Element>
Returns all descendant nodes matching the given selectors, using a preorder traversal. [...]
inherited
remove() Node
inherited
reparentChildren(Node newParent) → void
Move all the children of the current node to newParent. This is needed so that trees that don't store text as nodes move the text in the correct way.
inherited
replaceWith(Node otherNode) Node
Replaces this node with another node.
inherited
toString() String
Returns a string representation of this object.
override

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited