Prop Element Previouselementsibling
# HTML DOM previousElementSibling Property
[ Element Object](#)
## Example
Return the HTML content of the previous list item:
var x = document.getElementById("item2").previousElementSibling.innerHTML;
[Try it Β»](#)
* * *
## Definition and Usage
The previousElementSibling property returns the previous element at the same tree level (the previous element node in the same node tree).
The difference between the previousSibling and previousElementSibling properties:
* The previousSibling property returns the node (including text nodes, comment nodes) before the element node;
* The previousElementSibling property returns only the element node before the element node (excluding text nodes, comment nodes);
The previousElementSibling property is read-only.
**Tip:** Use the (#) property to return the next sibling element of the specified element.
**Tip:** Use the (#) property to return any child elements of the specified element.
* * *
## Browser Support
| Property | | | | | |
| --- | --- | --- | --- | --- | --- |
| previousElementSibling | 2.0 | 9.0 | 3.5 | 4.0 | 10.0 |
* * *
## Syntax
node.previousElementSibling
## Technical Details
| Return Value: | A Node object representing the previous sibling element of the element. Returns null if there is no previous sibling element. |
| :--- |
| DOM Version | DOM 3 |
* * Element Object](#)
YouTip