---
title: getPreviousNode
name: node-functions-getpreviousnode
---

Return the previous node in the tree. This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree.

-   Returns a node or null.

{% highlight js %}
const previousNode = node.getPreviousNode();
{% endhighlight %}
