Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get selected text

const getSelectedText = () => window.getSelection().toString();
Comment

Get Selected Text

const getSelectedText = () => window.getSelection().toString();

getSelectedText();
Comment

get the selected text

const getSelectedText = () => window.getSelection().toString();

getSelectedText(); // 'Lorem ipsum'
Comment

PREVIOUS NEXT
Code Example
Javascript :: js string replace array 
Javascript :: vue computed 
Javascript :: js scroll to bottom exact 
Javascript :: canvas set image height 
Javascript :: remove array item with index 
Javascript :: urlsearchparams to object 
Javascript :: Get Keys Of JSON As Array 
Javascript :: javascript jquery map a range of numbers 
Javascript :: jquery add class except this 
Javascript :: javascript select from array where 
Javascript :: create a simple website using javascript 
Javascript :: toFixed() javascript precision 
Javascript :: js sort by two numeric fields 
Javascript :: js stringify 
Javascript :: how to check what browser you are using 
Javascript :: jquery var_dump array 
Javascript :: function with for loop 
Javascript :: javascript string replace 
Javascript :: find if two elements in array sum to given integer js 
Javascript :: using template literals to create html 
Javascript :: datatable bootstrap cllick on specific button 
Javascript :: jquery append after number of chars in string 
Javascript :: How to Use the trim() String Method in javascript 
Javascript :: react concatenate string and component 
Javascript :: foeach in js 
Javascript :: how to add new line in jsx 
Javascript :: ios react native detect locale 
Javascript :: cra proxy 
Javascript :: run javascript sublime text 3 
Javascript :: get the location of an item in an array 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =