about summary refs log tree commit diff stats
path: root/src/html/dom.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/html/dom.nim')
-rw-r--r--src/html/dom.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 4afa953e..6e2e2a04 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -1607,8 +1607,8 @@ func previousElementSibling*(elem: Element): Element {.jsfget.} =
   if p == nil: return nil
   for i in countdown(elem.index - 1, 0):
     let node = p.childList[i]
-    if p.childList[i].nodeType == ELEMENT_NODE:
-      return elem
+    if node.nodeType == ELEMENT_NODE:
+      return Element(node)
   return nil
 
 func nextElementSibling*(elem: Element): Element {.jsfget.} =