Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #selected #text #input #javascript
ADD COMMENT
Topic
Name
4+2 =