标签:style http color os io ar 2014 art cti
根据浏览器判断,来定位光标的位置:
通过$.browser.msie来判断是否是IE浏览器
$(function() { $("#txt").click(function() { var position = 0; var txtFocus = document.getElementById("txt"); if ($.browser.msie) { var range = txtFocus.createTextRange(); range.move("character", position); range.select(); } else { //obj.setSelectionRange(startPosition, endPosition); txtFocus.setSelectionRange(position, position); txtFocus.focus(); } }); });
标签:style http color os io ar 2014 art cti
原文地址:http://my.oschina.net/u/1866821/blog/311744