Update article.md
This commit is contained in:
parent
09404a069e
commit
b82443d6b2
1 changed files with 4 additions and 5 deletions
|
@ -194,9 +194,9 @@ Others:
|
||||||
|
|
||||||
To manipulate the content within the range:
|
To manipulate the content within the range:
|
||||||
|
|
||||||
- `deleteContents()` - remove range content from the document
|
- `deleteContents()` -- remove range content from the document
|
||||||
- `extractContents()` - remove range content from the document and return as [DocumentFragment](info:modifying-document#document-fragment)
|
- `extractContents()` -- remove range content from the document and return as [DocumentFragment](info:modifying-document#document-fragment)
|
||||||
- `cloneContents()` - clone range content and return as [DocumentFragment](info:modifying-document#document-fragment)
|
- `cloneContents()` -- clone range content and return as [DocumentFragment](info:modifying-document#document-fragment)
|
||||||
- `insertNode(node)` -- insert `node` into the document at the beginning of the range
|
- `insertNode(node)` -- insert `node` into the document at the beginning of the range
|
||||||
- `surroundContents(node)` -- wrap `node` around range content. For this to work, the range must contain both opening and closing tags for all elements inside it: no partial ranges like `<i>abc`.
|
- `surroundContents(node)` -- wrap `node` around range content. For this to work, the range must contain both opening and closing tags for all elements inside it: no partial ranges like `<i>abc`.
|
||||||
|
|
||||||
|
@ -318,8 +318,7 @@ There are events on to keep track of selection:
|
||||||
|
|
||||||
### Selection tracking demo
|
### Selection tracking demo
|
||||||
|
|
||||||
Here's a small demo that shows selection boundaries
|
Here's a small demo that shows selection boundaries dynamically as it changes:
|
||||||
dynamically as it changes:
|
|
||||||
|
|
||||||
```html run height=80
|
```html run height=80
|
||||||
<p id="p">Select me: <i>italic</i> and <b>bold</b></p>
|
<p id="p">Select me: <i>italic</i> and <b>bold</b></p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue