摘要: 获取textarea的光标位置,并插入数据var start=0; var end=0; function add(){ var textBox = document.getElementById("ta"); var pre = textBox.value.substr(0, start); var post = textBox.value.substr(end); textBox.value = pre + document.getElementById("inputtext").value + post; } function savePos(te 阅读全文
posted @ 2012-10-07 03:41 一只柯楠 阅读(364) 评论(0) 推荐(0) 编辑