HTML DOM nextSiblingProperty

元素对象参考手册Element Object

Examples

Returns the node immediately following an element:

document.getElementById("item1").nextSibling;

Try it Yourself »

Definition and Usage

The nextSibling property returns the node immediately following an element (at the same tree level).

The returned node is returned as a node object.

Note:If there is no node immediately following the element, it returns null.null.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the nextSibling property.


Syntax

node.nextSibling

Technical Details

Return Value: The node immediately following the node, as a node object.
DOM Version Core Level 1 Node Object


元素对象参考手册Element Object

Other Extensions