/html-dom
/Basic
GitHub 4932★
Get the selected text
const
selectedText
=
window
.
getSelection
(
)
.
toString
(
)
;
See also
Copy highlighted code to the clipboard
Get the direction of the text selection
Paste as plain text
Save and restore the text selection
Select the text content of an element
Get the position of an element relative to another
Get the text content of an element
Follow me on
Twitter
and
GitHub
to get more useful contents.