摘要: /*** 获取选中文本,控制输入框输入光标位置。假如参数为空,则返回当前被选中的文字内容;* 假如一个参数则将光标设置在该位置;假如两个参数则将两参数之间的文字选中* 应用举例:$("#textarea").selectionRange($("#textarea").val().length);* @param {Number} start 设置光标的起始位置* @param {Number} end 设置光标的结束位置* @return {String} 假如参数个数为0则返回当前选中的文本,假如参数不为0则返回jQuery对象jQuery.fn.se 阅读全文
posted @ 2012-10-29 14:18 Mancy 阅读(419) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript">$(function(){ $('textarea').click(function(){ if($.browser.msie) this.createTextRange().select(); else { this.selectionStart = 0; this.selectionEnd = this.value.length; } })})</script> 阅读全文
posted @ 2012-10-29 14:11 Mancy 阅读(634) 评论(0) 推荐(0) 编辑