Easy Tutorial
❮ Dom Obj Password Met Canvas Rotate ❯

HTML DOM nextElementSibling Property

Element Object

Example

Return the HTML content of the next list item:

var x = document.getElementById("item1").nextElementSibling.innerHTML;

Definition and Usage

The nextElementSibling property returns the next sibling element of the specified element (the next element in the same tree level).

Differences between nextSibling and nextElementSibling properties:

The nextElementSibling property is read-only.

Tip: Use the previousElementSibling property to return the previous element of the specified element.

Tip: Use the children property to return any child elements of the specified element.


Browser Support

Property
nextElementSibling 2.0 9.0 3.5 4.0 10.0

Syntax

node.nextElementSibling

Technical Details

Return Value: Node object, representing the next sibling element, or null if there is no next sibling element.
DOM Version DOM 3
--- ---

Element Object

❮ Dom Obj Password Met Canvas Rotate ❯