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 :: javascript create json object from array 
Javascript :: find class 
Javascript :: react 18 rendering twice 
Javascript :: react mui icons 
Javascript :: remove from array javascript 
Javascript :: remove mime type from base64 javascript 
Javascript :: firebase messaging import script 
Javascript :: check all checkboxes on table 
Javascript :: setimmediate 
Javascript :: how to show multiple image preview in jquery 
Javascript :: javascript things to remember 
Javascript :: tailwincss in react native 
Javascript :: import error in react 
Javascript :: js anonymous function es6 
Javascript :: js setattribute download 
Javascript :: how to manage logging using winston for production and development in node js "github" 
Javascript :: random function javascript 
Javascript :: how to get css property of div after rendering in react js 
Javascript :: jest testing with ResizeObserver 
Javascript :: Javascript convert object value to array 
Javascript :: react get url params in class component 
Javascript :: using express js response render parameter in ejs script tag as a variable in node js 
Javascript :: Scaling an image to fit on canvas 
Javascript :: json.stringify 
Javascript :: how to add multiple styles in javascript 
Javascript :: javascript simple hash 
Javascript :: mongodb mongoose update convert string to object 
Javascript :: merg two array js 
Javascript :: redux store 
Javascript :: button dropdown not working on datatable search 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =