Skip to content

Commit 7db561c

Browse files
authored
Merge pull request #362 from odsantos/update-en-selection-range
Update "Selection and Range" files
2 parents cce02d8 + 0cc268c commit 7db561c

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

2-ui/99-ui-misc/02-selection-range/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ The range object that we created in the example above has following properties:
217217

218218
## Range selection methods
219219

220-
There are many convenience methods to manipulate ranges.
220+
There are many convenient methods to manipulate ranges.
221221

222222
We've already seen `setStart` and `setEnd`, here are other similar methods.
223223

@@ -408,7 +408,7 @@ From <input id="from" disabled> – To <input id="to" disabled>
408408
There are two approaches to copying the selected content:
409409
410410
1. We can use `document.getSelection().toString()` to get it as text.
411-
2. Otherwise, to copy the full DOM, e.g. if we need to keep formatting, we can get the underlying ranges with `getRangesAt(...)`. A `Range` object, in turn, has `cloneContents()` method that clones its content and returns as `DocumentFragment` object, that we can insert elsewhere.
411+
2. Otherwise, to copy the full DOM, e.g. if we need to keep formatting, we can get the underlying ranges with `getRangeAt(...)`. A `Range` object, in turn, has `cloneContents()` method that clones its content and returns as `DocumentFragment` object, that we can insert elsewhere.
412412
413413
Here's the demo of copying the selected content both as text and as DOM nodes:
414414
@@ -438,7 +438,7 @@ As text: <span id="astext"></span>
438438
439439
## Selection methods
440440
441-
We can work with the selection by addding/removing ranges:
441+
We can work with the selection by adding/removing ranges:
442442
443443
- `getRangeAt(i)` -- get i-th range, starting from `0`. In all browsers except Firefox, only `0` is used.
444444
- `addRange(range)` -- add `range` to selection. All browsers except Firefox ignore the call, if the selection already has an associated range.

2-ui/99-ui-misc/02-selection-range/range-example-p-0-1.svg

Lines changed: 1 addition & 1 deletion
Loading

2-ui/99-ui-misc/02-selection-range/range-example-p-1-3.svg

Lines changed: 1 addition & 1 deletion
Loading

2-ui/99-ui-misc/02-selection-range/range-example-p-2-b-3-range.svg

Lines changed: 1 addition & 1 deletion
Loading

2-ui/99-ui-misc/02-selection-range/range-example-p-2-b-3.svg

Lines changed: 1 addition & 1 deletion
Loading

2-ui/99-ui-misc/02-selection-range/selection-direction-backward.svg

Lines changed: 1 addition & 1 deletion
Loading

2-ui/99-ui-misc/02-selection-range/selection-direction-forward.svg

Lines changed: 1 addition & 1 deletion
Loading

2-ui/99-ui-misc/02-selection-range/selection-firefox.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)