function test(str)
{
var tc = document.getElementById("TextBox1");
var tclen = tc.value.length;
tc.focus();
if(typeof document.selection != "undefined")
{
document.selection.createRange().text = str;
}
else
{
tc.value = tc.value.substr(0,tc.selectionStart)+str+tc.value.substring(tc.selectionStart,tclen);
}
}
光标处插入内容
最新推荐文章于 2024-03-28 11:27:47 发布