1

what I want to do is to split the text of textarea on cursor position. For example if the text is "hello my world" when the user clicks at the end of hello and press some button then the text should be splitted into two a="hello" and b="my world". Is there anyway I can achieve this ?

A.J
  • 141
  • 5
  • 17

1 Answers1

0

Refer to this https://stackoverflow.com/a/1891567/409110 to get the current position of the cursor. Then you can simply split the string and store it.

Community
  • 1
  • 1
Amit
  • 3,952
  • 7
  • 46
  • 80