也就是判断光标在第几个字符后
------解决方案--------------------------------------------------------
板凳~~~~~~~~~~~~~~
------解决方案--------------------------------------------------------
顶一下
------解决方案--------------------------------------------------------
写个简单的 <input type= "text " id= "txt1 " onkeydown= "javascript:return ShowPos(); "/> <div id= "div1 "> </div> <script type= "text/javascript "> <!-- function ShowPos() { var s=document.selection.createRange(); s.setEndPoint( "StartToStart ",document.getElementById( "txt1 ").createTextRange()) var pos = s.text.length; document.getElementById( "div1 ").innerHTML = pos; }//--> </script>