Update snippet descriptions
This commit is contained in:
@ -3,9 +3,9 @@ title: getSelectedText
|
||||
tags: browser,beginner
|
||||
---
|
||||
|
||||
Get the currently selected text.
|
||||
Gets the currently selected text.
|
||||
|
||||
- Use `window.getSelection()` and `Selection.prototype.toString()` to get the currently selected text.
|
||||
- Use `Window.getSelection()` and `Selection.toString()` to get the currently selected text.
|
||||
|
||||
```js
|
||||
const getSelectedText = () => window.getSelection().toString();
|
||||
|
||||
Reference in New Issue
Block a user