ITPub博客

首页 > 应用开发 > Java > js 文本框插入

js 文本框插入

原创 Java 作者:zgy13121 时间:2008-11-12 15:29:06 0 删除 编辑
js 文本框插入 function insertAtCaret(textbox,text) { textbox.focus(); document.selection.createRange().text = text; } function inputCalc(str){ addText(document.getElementById("CalcuteText"),str); } /* function addText2(oTextarea,strText){ oTextarea.focus(); document.selection.createRange().text+=strText; oTextarea.blur(); } */ //在光标位置插入文本 function addText(oTextarea,strText){ //clipboardData.setData("text",strText); oTextarea.focus(); //document.execCommand("paste"); //oTextarea.focus(); document.selection.createRange().text = strText; }[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11419868/viewspace-1013255/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: connect by的妙用
请登录后发表评论 登录
全部评论

注册时间:2008-09-27

  • 博文量
    58
  • 访问量
    245378