Posted 6 months ago. Visible to the public.

How to get the currently selected text in Javascript

Simple:

Copy
window.getSelection().toString();

Browser support: IE9+, Android 4.3+, Safari 5+

Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Author of this card:

Avatar
Dominik Schöler
Last edit:
6 months ago
by Dominik Schöler
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Dominik Schöler to makandropedia