Appending a character, to textarea.
Hi! Im using this to add text to a textarea:
http://api.jquery.com/val/
How do I append a character, to where the text cursor is, in a textarea?
I would like to do this so users could add special characters to their comments (like this one: ♥). thank you.
this is my code:
<pre>
$("#special-char-1").click(function () {
var text = $(this).text();
$("#comment").val(text);
});
</pre>