diff --git a/files/en-us/web/api/range/extractcontents/index.md b/files/en-us/web/api/range/extractcontents/index.md index 79480f9d2866e93..e2614603da657dc 100644 --- a/files/en-us/web/api/range/extractcontents/index.md +++ b/files/en-us/web/api/range/extractcontents/index.md @@ -86,7 +86,7 @@ const list2 = document.getElementById("list2"); const button = document.getElementById("swap"); button.addEventListener("click", (e) => { - selection = window.getSelection(); + const selection = window.getSelection(); for (let i = 0; i < selection.rangeCount; i++) { const range = selection.getRangeAt(i);