DOM

DOM

Source

CharacterData/previousElementSibling

In all current engines.

Firefox25+Safari9+Chrome29+ Opera16+Edge79+ Edge (Legacy)17+IENone Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+

Element/previousElementSibling

In all current engines.

Firefox3.5+Safari4+Chrome1+ Opera10+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+

The previousElementSibling getter
steps are to return the first preceding sibling that is an element; otherwise null.

CharacterData/nextElementSibling

In all current engines.

Firefox25+Safari9+Chrome29+ Opera16+Edge79+ Edge (Legacy)17+IENone Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+

Element/nextElementSibling

In all current engines.

Firefox3.5+Safari4+Chrome1+ Opera10+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+

The nextElementSibling getter
steps are to return the first following sibling that is an element; otherwise null.

ChildNode

In all current engines.

Firefox23+Safari4+Chrome1+ Opera10+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android23+iOS SafariYesChrome for AndroidYesAndroid WebView1+Samsung InternetYesOpera Mobile10.1+


interface mixin ChildNode { [); [); [); [CEReactions, Unscopable] undefined remove();
};
DocumentType includes ChildNode;
Element includes ChildNode;
CharacterData includes ChildNode;
node . before(...nodes)

Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

node . after(...nodes)

Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

node . replaceWith(...nodes)

Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

node . remove() Removes node.

ChildNode/before

In all current engines.

Firefox49+Safari10+Chrome54+ Opera39+Edge79+ Edge (Legacy)17+IENone Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+

The before(nodes) method steps are:

ChildNode/after

In all current engines.

Firefox49+Safari10+Chrome54+ Opera39+Edge79+ Edge (Legacy)17+IENone Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+

The after(nodes) method steps are:

ChildNode/replaceWith

In all current engines.

Firefox49+SafariYesChrome54+ Opera39+Edge79+ Edge (Legacy)17+IENone Firefox for Android49+iOS SafariYesChrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+

The replaceWith(nodes) method steps are:

ChildNode/remove

In all current engines.

Firefox23+Safari7+Chrome23+ Opera15+Edge79+ Edge (Legacy)12+IENone Firefox for Android23+iOS Safari7+Chrome for Android25+Android WebView37+Samsung Internet1.5+Opera Mobile14+

The method steps are:

  1. If this’s parent is null, then return.

  2. Remove this.

interface mixin Slottable { readonly attribute HTMLSlotElement? assignedSlot;
};
Element includes Slottable;
Text includes Slottable;

Element/assignedSlot

In all current engines.

Firefox63+Safari10.1+Chrome53+ Opera40+Edge79+ Edge (Legacy)NoneIENone Firefox for Android63+iOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+

Text/assignedSlot

In all current engines.

FirefoxYesSafari10.1+Chrome53+ Opera40+Edge79+ Edge (Legacy)18IENone Firefox for AndroidYesiOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+

The assignedSlot getter steps are to return the result of find a slot given this and with the open flag set.

A collection is an object that represents a list of nodes. A collection can be either live or static.
Unless otherwise stated, a collection must be live.

If a collection is live, then the attributes and methods
on that object must operate on the actual underlying data, not a snapshot of
the data.

When a collection is created, a
filter and a root are associated with it.

The collection then represents a view of the subtree rooted at the collection’s root, containing only nodes that match the
given filter. The view is linear. In the absence of specific requirements to the contrary, the nodes
within the collection must be sorted in tree order.

NodeList

In all current engines.

Firefox1+Safari1+Chrome1+ Opera8+Edge79+ Edge (Legacy)12+IE5+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+

A NodeList object is a collection of nodes.


[Exposed=Window]
interface NodeList { getter ); readonly attribute unsigned long length; iterable<Node>;
};
collection . length Returns the number of nodes in the collection. element = collection . item(index) element = collection[index] Returns the node with index index from the collection. The nodes are sorted in tree order.

The object’s supported property indices are the numbers in the range zero to one less than
the number of nodes represented by the collection. If there are no such
elements, then there are no supported property indices.

NodeList/length

In all current engines.

Firefox1+SafariYesChrome1+ OperaYesEdge79+ Edge (Legacy)12+IE5+ Firefox for Android4+iOS SafariYesChrome for AndroidYesAndroid WebViewYesSamsung InternetYesOpera MobileYes

The length attribute must return the number of nodes represented by the collection.

NodeList/item

In all current engines.

Firefox1+Safari1+Chrome1+ OperaYesEdge79+ Edge (Legacy)12+IE5+ Firefox for Android4+iOS Safari1+Chrome for AndroidYesAndroid WebViewYesSamsung InternetYesOpera MobileYes

The item(index) method must return the indexth node in the collection. If there is no indexth node in the collection, then the method must return
null.

HTMLCollection

In all current engines.

Firefox1+Safari1+Chrome1+ Opera8+Edge79+ Edge (Legacy)12+IE8+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+


[Exposed=Window, LegacyUnenumerableNamedProperties]
interface HTMLCollection { readonly attribute ); getter );
};

An HTMLCollection object is a collection of elements.

HTMLCollection is a historical artifact we cannot rid the web of.
While developers are of course welcome to keep using it, new API standard designers ought not to use
it (use sequence<T> in IDL instead).

collection . length Returns the number of elements in the collection. element = collection . item(index) element = collection[index] Returns the element with index index from the collection. The elements are sorted in tree order. element = collection . namedItem(name) element = collection[name] Returns the first element with ID or name name from the collection.

The object’s supported property indices are the numbers in the range zero to one less than
the number of elements represented by the collection. If there are no such
elements, then there are no supported property indices.

The length getter steps are to return the
number of nodes represented by the collection.

The item(index) method steps are to
return the indexth element in the collection. If there
is no indexth element in the collection, then the method
must return null.

The method steps are:

HTMLSlotElement/slotchange_event

In all current engines.

Firefox63+Safari10.1+Chrome53+ Opera40+Edge79+ Edge (Legacy)NoneIENone Firefox for Android63+iOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+

Each similar-origin window agent has a mutation observer microtask queued (a boolean), which is initially false. [HTML]

Each similar-origin window agent also has mutation observers (a set of zero or more MutationObserver objects), which is initially empty.

To queue a mutation observer microtask,
run these steps:

To notify mutation observers, run these steps:



Read Next page

Report Page