I asked that same question -- twice -- and got no answer. . . *sigh* But I found a start for you (only works in IE; I know, I know, thats really lame, but hey, it's a start.):
Code:
function PlaceTag(tag){
var selectedText = document.selection.createRange().text;
if (selectedText != "") {
var newText = "(" + tag + "]" + selectedText + "[" + tag + ")";
document.selection.createRange().text = newText;
} else {
input = document.getElementById("input");
input.value = input.value + "("+tag+"]["+tag+")";
}
}
Bookmarks