aspxtreme

previousSibling Property

HTML Elements/DHTML Objects   Element Attributes


DOM Level 1 Specification.

Returns a reference to the node that immediately precedes this node.

Syntax


HTML N/A
Script [ oElement = ] object.previousSibling

Possible Values


oElement Reference to the previous sibling of an object.

If there is no such node, this property returns null. The property is read-only with no default value.

Example

The following sample demonstrates the implementation of the previousSibling property to obtain the previous sibling of an object.

<script language="JavaScript">
// returns the list item labelled 'List Item 1'
var oSibling = oList.childNodes ( 1 ).previousSibling;
</script>
...
<body>
<ul ID = oList>
  <li>
  <li>List Item 1
  <li>
  <li>List Item 2
  <li>
  <li>List Item 3
</ul>
</body>
See Also

firstChild, nextSibling, lastChild



Books and more ...

Contents
HTML Elements / DOM Objects
HTML Element Attributes
CSS Attributes
DOM Object Properties
DOM-compliant Events Reference
DOM Methods Reference
DOM Collections Reference
 


Suggested Reading



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme