diff --git a/2-ui/99-ui-misc/02-selection-range/article.md b/2-ui/99-ui-misc/02-selection-range/article.md index fd2989c1..d6c8762c 100644 --- a/2-ui/99-ui-misc/02-selection-range/article.md +++ b/2-ui/99-ui-misc/02-selection-range/article.md @@ -357,7 +357,7 @@ As text: cloned.innerHTML = astext.innerHTML = ""; // Clone DOM nodes from ranges (we support multiselect here) - for (let i = 0; i < selection; i++) { + for (let i = 0; i < selection.rangeCount; i++) { cloned.append(selection.getRangeAt(i).cloneContents()); } @@ -628,7 +628,7 @@ The most used recipes are probably: // then apply Range methods to selection.getRangeAt(0) // or, like here, to all ranges to support multi-select - for (let i = 0; i < selection; i++) { + for (let i = 0; i < selection.rangeCount; i++) { cloned.append(selection.getRangeAt(i).cloneContents()); } ```