DOM

DOM

Source

Element/getElementsByTagName

In all current engines.

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

The getElementsByTagName(qualifiedName) method steps are to return the list of elements with qualified name qualifiedName for this.

Element/getElementsByTagNameNS

In all current engines.

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

The getElementsByTagNameNS(namespace, localName) method steps are to return the list of elements with namespace namespace and local
name localName
for this.

Element/getElementsByClassName

In all current engines.

Firefox3+Safari6+Chrome1+ Opera9.5+Edge79+ Edge (Legacy)16+IE9+ Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+

The getElementsByClassName(classNames) method steps are to return the list of elements with class names classNames for this.

To insert adjacent, given an element element, string where, and a node node, run the steps associated with the first ASCII case-insensitive match for where:

"beforebegin"

If element’s parent is null, return null.

Return the result of pre-inserting node into element’s parent before element.

"afterbegin"

Return the result of pre-inserting node into element before element’s first child.

"beforeend"

Return the result of pre-inserting node into element before null.

"afterend"

If element’s parent is null, return null.

Return the result of pre-inserting node into element’s parent before element’s next sibling.

Otherwise

Throw a "SyntaxError" DOMException.

Element/insertAdjacentElement

In all current engines.

Firefox48+Safari3+Chrome1+ Opera8+Edge79+ Edge (Legacy)17+IE5+ Firefox for Android48+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+

The insertAdjacentElement(where, element) method steps are to return the result of running insert adjacent, give this, where, and element.

Element/insertAdjacentText

In all current engines.

Firefox48+Safari4+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)17+IE5+ Firefox for Android48+iOS Safari4+Chrome for Android18+Android WebView2.3+Samsung Internet1.0+Opera Mobile12.1+

The insertAdjacentText(where, data) method steps are:

This method returns nothing because it existed before we had a chance to design it.

NamedNodeMap

In all current engines.

Firefox34+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE5+ Firefox for Android34+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+


[Exposed=Window, LegacyUnenumerableNamedProperties]
interface NamedNodeMap { readonly attribute ); getter ); , ); [); [); [CEReactions] Attr removeNamedItem(DOMString ); [CEReactions] Attr removeNamedItemNS(DOMString? , DOMString );
};

A NamedNodeMap has an associated element (an element).

A NamedNodeMap object’s attribute list is its element’s attribute list.

A NamedNodeMap object’s supported property indices are the numbers in the
range zero to its attribute list’s size minus one, unless
the attribute list is empty, in which case there are no supported property indices.

The length getter steps are to return
the attribute list’s size.

The item(index) method steps are:

A NamedNodeMap object’s supported property names are the return value of running these
steps:

The getNamedItem(qualifiedName) method steps are to return the result of getting an attribute given qualifiedName and element.

The getNamedItemNS(namespace, localName) method steps are to return the result of getting an attribute given namespace, localName, and element.

The setNamedItem(attr) and setNamedItemNS(attr) method steps are
to return the result of setting an attribute given attr and element.

The method steps are:

The method steps are:

Attr

In all current engines.

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


[Exposed=Window]
interface Attr : Node { readonly attribute DOMString? namespaceURI; readonly attribute DOMString? prefix; readonly attribute DOMString localName; readonly attribute DOMString name; [CEReactions] attribute DOMString value; readonly attribute Element? ownerElement; readonly attribute boolean specified; // useless; always returns true
};

Attr nodes are simply known as attributes. They are sometimes referred
to as content attributes to avoid confusion with IDL attributes.

Attributes have a namespace (null or a non-empty string), namespace prefix (null or a non-empty string), local name (a non-empty string), value (a string), and element (null or an element).

If designed today they would just have a name and value. ☹

An attribute’s qualified name is its local name if its namespace prefix is null, and its namespace prefix, followed by ":", followed by its local name, otherwise.

User agents could have this as an internal slot as an optimization.

When an attribute is created, its local name is given. Unless explicitly
given when an attribute is created, its namespace, namespace prefix, and element are set to null, and its value is set to the empty string.

An A attribute is an attribute whose local name is A and whose namespace and namespace prefix are
null.

Attr/namespaceURI

In all current engines.

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

The namespaceURI getter steps are to return this’s namespace.

Attr/prefix

In all current engines.

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

The prefix getter steps are to return this’s namespace prefix.

Attr/localName

In all current engines.

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

The localName getter steps are to return this’s local name.

The name getter steps are to return this’s qualified name.

The value getter steps are to return this’s value.

To set an existing attribute value, given an attribute attribute and
string value, run these steps:

  1. If attribute’s element is null, then set attribute’s value to value.

  2. Otherwise, change attribute to value.

The value setter steps are to set an existing attribute value with this and the given value.

The ownerElement getter steps are to return this’s element.

The specified getter steps are to return true.

CharacterData

In all current engines.

Firefox1+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE5+ Firefox for AndroidYesiOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+


[Exposed=Window]
interface CharacterData : , ); ); , ); , ); , , );
};


Read Next page

Report Page