js文本框插入

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@]
当前名称:js文本框插入
文章地址:http://scyanting.com/article/gghcij.html