HTML DOM nextSibling Property
Example
Return the node immediately following a certain element:
document
.
getElementById
(
"
item1
"
)
.
nextSibling
;
Try it »
Definition and Usage
The nextSibling property returns the node immediately following a certain element (at the same level in the tree).
The node is returned as a node object.
Note: If there is no node immediately after the element, it returns null.
Browser support





All major browsers support the nextSibling property
Syntax
node
.nextSibling
Technical Details
| Return Value: | The node immediately following, as a node object. |
|---|---|
| DOM version | Core Level 1 Node Object |
Element object