0

I'm trying to insert highlighted text in a textarea so when you start typing the highlighted text get deleted.

The same mechanism used by Stackoverflow when inserting code, for example when you press the curly brackets button: enter image description here

Sunderam Dubey
  • 1
  • 11
  • 20
  • 40
giovnn
  • 21
  • 5
  • I think that's for code blocks, or if you simply add ```in this``` with respective langauge tag, that's also for code blocks – Sunderam Dubey Jun 07 '22 at 10:13
  • 1
    It's an old question, but this seems to cover what you want: [Programmatically selecting partial text in an input field](https://stackoverflow.com/questions/646611/programmatically-selecting-partial-text-in-an-input-field). Using that combined with however you are inserting text should do the job. – DBS Jun 07 '22 at 10:15
  • yeah @DBS , it helped so this is basically a duplicate. – giovnn Jun 07 '22 at 12:59

0 Answers0