function edit(TextId, Text1, Text2) {
    if ((document.selection) && (document.selection.type == "Text") && (document.selection.createRange().parentElement().id == TextId)) {        document.selection.createRange().text = Text1 + document.selection.createRange().text + Text2;
        document.selection.empty();
    }
    else {
        alert("先在输入框中选中你要改变的文字。");
    }
}上面代码在本机默认IE6通过,功能发挥正常,,火狐里不行,都执行的ELSE里的提示,不知道是哪个方法不适用,或者用别的方法能实现上面的功能又能很兼容的?我要选中指定文本框里的内容,然后点按扭,改变选中的内容(前后加括号什么的),,同页面下可能有两到三个文本框,,感谢帮忙解决的朋友,祝你们生活愉快,,,