Interface

Element

Element

Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.

View Source js/lib.dom.d.ts, line 1678

Members

ShadowRoot

# attachShadow

Creates a shadow root for element and returns it.

View Source js/lib.dom.d.ts, line 1726

DOMTokenList

# classList

Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.

View Source js/lib.dom.d.ts, line 1681

string

# className

Returns the value of element's class content attribute. Can be set to change it.

View Source js/lib.dom.d.ts, line 1686

# closest

Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.

View Source js/lib.dom.d.ts, line 1731

string | null

# getAttribute

Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.

View Source js/lib.dom.d.ts, line 1736

Array

# getAttributeNames

Returns the qualified names of all element's attributes. Can contain duplicates.

View Source js/lib.dom.d.ts, line 1746

string | null

# getAttributeNS

Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.

View Source js/lib.dom.d.ts, line 1741

HTMLCollectionOf.<Element>

# getElementsByClassName

Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.

View Source js/lib.dom.d.ts, line 1751

boolean

# hasAttribute

Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.

View Source js/lib.dom.d.ts, line 1756

boolean

# hasAttributeNS

Returns true if element has an attribute whose namespace is namespace and local name is localName.

View Source js/lib.dom.d.ts, line 1761

boolean

# hasAttributes

Returns true if element has attributes, and false otherwise.

View Source js/lib.dom.d.ts, line 1766

string

# id

Returns the value of element's id content attribute. Can be set to change it.

View Source js/lib.dom.d.ts, line 1691

string

# localName

Returns the local name.

View Source js/lib.dom.d.ts, line 1696

boolean

# matches

Returns true if matching selectors against element's root yields element, and false otherwise.

View Source js/lib.dom.d.ts, line 1771

string | null

# namespaceURI

Returns the namespace.

View Source js/lib.dom.d.ts, line 1701

string | null

# prefix

Returns the namespace prefix.

View Source js/lib.dom.d.ts, line 1706

void

# removeAttribute

Removes element's first attribute whose qualified name is qualifiedName.

View Source js/lib.dom.d.ts, line 1776

void

# removeAttributeNS

Removes element's attribute whose namespace is namespace and local name is localName.

View Source js/lib.dom.d.ts, line 1781

Promise.<void>

# requestFullscreen

Displays element fullscreen and resolves promise when done.

When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.

View Source js/lib.dom.d.ts, line 1786

void

# setAttribute

Sets the value of element's first attribute whose qualified name is qualifiedName to value.

View Source js/lib.dom.d.ts, line 1793

void

# setAttributeNS

Sets the value of element's attribute whose namespace is namespace and local name is localName to value.

View Source js/lib.dom.d.ts, line 1798

ShadowRoot | null

# shadowRoot

Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.

View Source js/lib.dom.d.ts, line 1711

string

# slot

Returns the value of element's slot content attribute. Can be set to change it.

View Source js/lib.dom.d.ts, line 1716

string

# tagName

Returns the HTML-uppercased qualified name.

View Source js/lib.dom.d.ts, line 1721

boolean

# toggleAttribute

If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.

Returns true if qualifiedName is now present, and false otherwise.

View Source js/lib.dom.d.ts, line 1803