Name
Element: an HTML or XML element — DOM Level 1 Core: Node → Element
Subinterfaces
HTMLElement
Properties
-
readonly String tagName The tag name of the element. This is the string “P” for an HTML
<p>element, for example. For HTML documents, the tag name is returned in uppercase, regardless of its capitalization in the document source. XML documents are case-sensitive, and the tag name is returned exactly as it is written in the document source. This property has the same value as the inheritednodeNameproperty of the Node interface.
Methods
-
addEventListener( ) Adds an event-handler function to the set of event handlers for this element. This is a DOM-standard method supported by all modern browsers except IE.
-
attachEvent( ) Adds an event-handler function to the set of handlers for this element. This is the IE-specific alternative to
addEventListener( ).-
detachEvent( ) Removes an event-handler function from this element. This is the IE-specific alternative to the standard
removeEventListener( )method.-
dispatchEvent( ) Dispatches a synthetic event to this node.
-
getAttribute( ) Returns the value of a named attribute as a string.
-
getAttributeNS( ) Returns the string value of an attribute specified by local name and namespace URI. Useful only with XML documents that use namespaces.
-
getAttributeNode( ) Returns the value of a named attribute as an Attr node.
-
getAttributeNodeNS( ) Returns the Attr value of an attribute specified by local name and namespace URI. Useful only with XML documents ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access