Easy Tutorial
❮ Event Onsuspend Prop Style Borderimagewidth ❯

HTML DOM nodeName Property

Element Object

Example

Get the node name of the body element:

Output result:


Definition and Usage

The nodeName property returns the name of the node, depending on its type.

If the node is an element node, the nodeName property returns the tag name.

If the node is an attribute node, the nodeName property returns the attribute name.

For other node types, the nodeName property returns different node names based on the node type.


Browser Support

All major browsers support the nodeName property.


Syntax

Technical Details

Return Value: String, representing the name of the node.
DOM Version Core Level 1 Node Object
--- ---

Element Object

❮ Event Onsuspend Prop Style Borderimagewidth ❯