showing results for - "javascript get selected text"
Bautista
31 Jan 2017
1// Get highlighted text this way:
2
3window.getSelection().toString()
Regina
12 Aug 2020
1var sel = document.getElementById("box1");
2var text= sel.options[sel.selectedIndex].text;
3
Quintrell
10 May 2017
1function disp() {
2  var text = document.getElementById("text");
3  var t = text.value.substr(text.selectionStart, text.selectionEnd - text.selectionStart);
4  alert(t);
5}
Yusuf
13 Jul 2018
1const getSelectedText = () => window.getSelection().toString();
2
3getSelectedText();
4
queries leading to this page
js get selected option textjavascript get tags from selected textget the highlight selected text pythonjavascript get option with textjs get select option texthow to get select text javascriptgrab highlighted text with javascriptget the selected text in javascript from a divget text selected option javascripthjs how get selected texthow to get text of selected option in javascriptjs get option textselect get selected option text javascriptselect text highlighting javascriptjs get selected textget selected option text with javascripthow to find the highlighted area in jsread selected text using javascriptjs get select current option texthtml find selected textjs get text from select option selectedget selected text from htmlhow to get highlighted text only using javascripthow to see the currently selected textget highlighted text javascriptjs get element where text is being selectedget text selected jsget selected text javascriptget element for the highlighted text javascriptjavascript get option that has textget splited text javascripthow to get the inside text of selected option in javascriptget dropdown selected text in javascriptjs select get text valueget selected text in document jsjavascrip get selected valuesjavascript get selected text from inputhtml slected textselected text javascripthow to get the highlighted text in javascriptwindow getselection get all textjs get current selected textget value of selected text in jshow to get text from selected option javascriptjavascript get text from selected optionjs highlighted valuejavascript selected textaccess to selected text with javascriptget selected text in javascriptjavascript get the text of selected optionhow to get dropdown selected item text in javascriptget text of selected option javascriptjs get selected wordget text of a selected option javascriptslatejs get selected textget selected value as text in jsjavascript get selected valuecheck where in text its selected javascripthighlight text as i read javascriptjavascript get selected text in divjavascript get text of a html select from a value of elementget the selected texts element in jsget the text value of a selected option in javascriptjs get element selected text inhow to get highlighted selection in jsget selected text javacsriptjavascript show text box when select option is selectedjavascript get option text of selected valueinput get selected texthow to get selected option text in javascripthow to get selected option text in jsjavascript get text selectedjs get option 3aselected text valueget selected text in browser javascript usingget selected text in jsjs select text in inputhow to get the text of selected option in javascriptjs get selected text of a select tagget selected text in div javascriptjs get user selectionget selected text html javascripthow to get the selected options text in jsget selected option text javascriptget selected value text javascriptjavascript access highlight textjs get highlighted textget text of select option javascriptselect option get text javascriptget location of selected text javascripthtml current highlighted areajs get selected text with htmlhow to get selected text in jsget element with text selected javascriptget the selected option text jswhen checked get text jsget selected option javascript textselect option get selected text jsselect get selected option text javascriptjavascript get option selected textget selected text in option in javascriptget selected text in browser javascripthow to get a text of a specific select value in javascripthow to get selected text using javascriptjs get text of selected optionjavascript get value of selected textget the selected words from input javascriptget text value of selected option javascripthow to get option text in jsjavascript get marked textjavascript get selected textboxjavascript get text of selected selecthow to get selected text in javascriptjavascript get higlighted textcheck selected text javascripthow to get the text user selected in jsget text option selected javascripthow store text is selected javascripthow to get the text selection in jsjs how marked textget text from option javascriptget selected option value and text jshow to know that text is selected javascriptget start of selected text javascriptselected text in javascriptselect selected text javascriptget the text of a option jsjavascript get current text of select elementextract only selected text to var in javascriptjavascript get selected text from selecthow to get a selected text using jswindow get selected textselect get selected text javascriptjavascript get selection with htmlget selected text input javascriptget the text of selected option javascripttext is selected javascriptevent js get selected textget text of selected option jsjs get selected text in html formatjs get the selected textselected text jsjs get text selected by userget select text jsjs selected textget selected text from a page javascriptget selected option texthow to get the selected text in jsjs get text infront of selected textjavascript select get selected textgjs get selected textget selected text javascript in wordget the selected text javascriptjs select option by textjs select get textget selected text jsevent get selected text jsjavascript find a option with textvalue of highlighted text javascripthow to get selected text javascriptalert selected text in the doc in jsjavascript get text of selected optionget the selected text element in jsjavascript if text is selectedhow to get selected tex in jsjavascript get selected textjs hpw get selected textjs get option selected texthow to get selected text in input javascriptget text selected javascripthow to get selected text from select in javascriptget value of selected text javascriptinput text selected javascripthow to get highlighted text in javascriptjavascript get selected option textget selected text in slate jshow to get the selected text in javascripthow to get highlighted text only using javascript exampleget selected text 2b jsjavascript get selected option value and texthow to get the text value from selected option in javascriptjavascript get option textselected option text javascriptjavascript get selected text