</dom>
60/121
Get the selected text
Edit this page
const
selectedText =
window
.getSelection().toString();
Might be useful
Copy highlighted code to the clipboard
advanced
Get the direction of the text selection
intermediate
Paste as plain text
intermediate
Save and restore the text selection
intermediate
Select the text content of an element
basic
← Get the position of an element relative to the document
Get the size of an image →
Hit the Subscribe button for the latest news on my tools. No spam. Ever!
Subscribe
Products
1 LOC
new
favorite JavaScript utilities in single line of code
Blur Page
a browser extension to hide sensitive element on page
Check Browsers Support
a browser extension to check browser compatibility without leaving your tab
CSS Layout
a collection of popular layouts and patterns made with CSS
Fake Numbers
a JavaScript library to fake a number
Form Validation
the best validation library for JavaScript
HTML DOM
common tasks of managing HTML DOM with vanilla JavaScript
React PDF Viewer
a PDF viewer made for React
this VS that
the differences between ___ and ___ in the front-end development
Follow me
I love building products!
Twitter
@nghuuphuoc
dev.to
@phuocng
GitHub
@phuoc-ng
© 2020 Nguyen Huu Phuoc. All rights reserved