I'm wondering how I can insert text into a text area using jquery, upon the click of an anchor tag.
I don't want to replace text already in textarea, I want to append new text to textarea.
I'm wondering how I can insert text into a text area using jquery, upon the click of an anchor tag.
I don't want to replace text already in textarea, I want to append new text to textarea.
I think this would be better
this one allow you "inject" a piece of text to textbox, inject means: appends the text where cursor is.
And you can use it like this:
Funny and have more sence when we have "Insert Tag into Text" functionality.
works in all browsers.
Hej this is a modified version which works OK in FF @least for me and inserts at the carets position
have you tried:
not sure about autohighlighting, though.
EDIT:
To append:
This is similar to the answer given by @panchicore with a minor bug fixed.
Here is a quick solution that works in jQuery 1.9+:
a) Get caret position:
b) Append text at caret position:
c) Example