Sure that's possible.

var text2insert= "blahdeeblah";
var ta= document.activeElement;
if (ta.tagName.toLowerCase() == 'textarea') {
        var startPos = ta.selectionStart;
        var endPos = ta.selectionEnd;
        ta.value= ta.value.substr(0,startPos) + text2insert + 
ta.value.substr(endPos);
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent('input', true, true );
        ta.dispatchEvent(evt);
        ta.setSelectionRange(startPos, endPos+text2insert.length);
}
void(0);



-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to