I am working on a little emoji function. My problem is when I have a text in the textarea and select an emoji from the drop down the emoji always goes to the end of the text even if I place the cursor at the beginning of the text, the emoji will go to the end of the text like so:
Some text here
View attachment 243231
The code:
function insertSmiley(smiley)
{
var currentText = document.getElementById("textarea");
var smileyWithPadding =" "+ smiley +" ";
currentText.value +=...
Code (markup):
Cursor position in textarea on insert
from JavaScript http://bit.ly/2KYoOrr
via
IFTTT
0 Comments