0

Can someone please help to modify the following code to run as simple js function from a button, and show the the highlighted text and its position in another textarea? I've tried to use the variables appearing in console.log. But it didn't work. the source of the code

https://stackoverflow.com/questions/60359921/how-to-get-highlighted-text-position-from-textarea
Blue Line
  • 31
  • 1
  • 5

1 Answers1

0

I simply tried to reuse the variable, but it didn't work. document.getElementById("n3").value = startPos;

Blue Line
  • 31
  • 1
  • 5