I want to add a word, where the cursor is. It should be something like this:
addWordToTextarea(word){
var tmpMyTextArea = document.getElementById('myTextArea').innerHTML.value;
var tmpCursorPositionInTextarea = document.getCursorFromId('myTextArea'); //does something like this function exist?
if(tmpCursorPositionInTextarea){
//add word to tmpMyTextarea on position where cursor is;
} else {
tmpMyTextArea = word;
}
}