DHTML Object Properties DHTML Objects
DOM Level 1 Specification.
Returns a reference to the node that immediately follows this node.
HTML |
N/A |
Script |
[ oElement = ] object.nextSibling |
oElement |
Reference to the next sibling of an object. |
If there is no such node, this property returns null. The property is read-only with no default value.
The following sample demonstrates the implementation of the nextSibling attribute to obtain the next sibling of a list item.
<script language="JavaScript">
var oSibling = oList.childNodes ( 0 ).nextSibling;
</script>
...
<body>
<ul id = oList>
<li>
<li>List Item 1
<li>
<li>List Item 2
<li>
<li>List Item 3
</ul>
</body>
firstChild, previousSibling, lastChild