From c0860b96ea7443384eec8721f262bd6e231c2fa5 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 5 Jan 2021 22:45:34 +0200 Subject: [PATCH] Update getAncestors.md --- snippets/getAncestors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/getAncestors.md b/snippets/getAncestors.md index 3dacd10de..3fa7691fd 100644 --- a/snippets/getAncestors.md +++ b/snippets/getAncestors.md @@ -5,7 +5,7 @@ tags: browser,beginner Returns all the ancestors of an element from the document root to the given element. -- Use a `Node.parentNode` and a `while` loop to move up the ancestor tree of the element. +- Use `Node.parentNode` and a `while` loop to move up the ancestor tree of the element. - Use `Array.prototype.unshift()` to add each new ancestor to the start of the array. ```js