function AppTag(tagcode)
{
document.PostMessage.Message.value = tagcode;
}
function InsertTag(tagbegin,tagend)
{
if ((document.selection)&&(document.selection.type == "Text")) {
var range = document.selection.createRange();
var ch_text=range.text;
range.text = tagbegin ch_text tagend;
}
else
{
document.PostMessage.Message.value=tagbegin document.PostMessage.Message.value tagend;
document.PostMessage.Message.focus();
}
}
调用:
执行操作的图标按钮:
其中[ImgFace1],[B],[/B]为要插入的文字
var range = document.selection.createRange();
var ch_text=range.text;
这是得到文本框选中的文字
被操作的文本框:
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn