回答編集履歴
1
markdown修正
test
CHANGED
@@ -10,4 +10,14 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
また、標準は `getSelection()` なので
|
13
|
+
また、標準は `getSelection()` なので `getSelection()` を優先した方が良いと思います。
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
```JavaScript
|
18
|
+
|
19
|
+
var doc = document,
|
20
|
+
|
21
|
+
txt = typeof doc.getSelection === 'function' ? doc.getSelection().toString() : doc.selection.createRange().text;
|
22
|
+
|
23
|
+
```
|