2012年3月28日
摘要: 最近工作需要写了一个工具方法用来在textarea里面插入文本,代码如下: ctx.insertText = function (el, txt) { var dom = el.get(0); if (window.getSelection) { var start = dom.selectionStart, end = dom.selectionEnd, temp = dom.value; dom.value = temp.substring(0, start) + txt + temp.substring(end... 阅读全文
posted @ 2012-03-28 17:15 rulee 阅读(295) 评论(0) 推荐(0) 编辑