Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get selected text js

// Get highlighted text this way:

window.getSelection().toString()
Comment

get selected text input javascript

function disp() {
  var text = document.getElementById("text");
  var t = text.value.substr(text.selectionStart, text.selectionEnd - text.selectionStart);
  alert(t);
}
Comment

javascript get selected text

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

getSelectedText();
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript trigger button click using class name 
Javascript :: javascript numero al cuadrado 
Javascript :: remove menu bar electron 
Javascript :: length of elements with display none 
Javascript :: javascript delete cookie 
Javascript :: how to print to console javascript 
Javascript :: javascript after dom ready 
Javascript :: get ng content element angular 2 
Javascript :: js function return fetch result 
Javascript :: jquery redirect to url 
Javascript :: how to open html file with javascript 
Javascript :: node readFileSync json 
Javascript :: javascript removing smallest number in array 
Javascript :: js map value in range 
Javascript :: how to detect a button click in javascript 
Javascript :: js html table extract data 
Javascript :: document queryselector click event 
Javascript :: set dropdown value using jquery 
Javascript :: npm react router dom 
Javascript :: validate file size in js 
Javascript :: scroll to top in react 
Javascript :: validate json file programmatically in python 
Javascript :: fizzbuzz js 
Javascript :: javascript read input from terminal 
Javascript :: switch browser to fullscreen 
Javascript :: detect mi browser 
Javascript :: an image gallery is a set of images with corresponding remove buttons 
Javascript :: javascript iterate over object 
Javascript :: how to prepare key in object dyamically javascript 
Javascript :: get top n objects from list node js 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =