我是说<input type="text" name=".... >的文本框. 
神啊,救救我吧!

解决方案 »

  1.   

    我可以给你一个比较曲折的方法(如下)。
    也许还有其他方法,
    <input type=text id=edit1 value="hello,world">
    <button onclick=alert(GetCurPos())>看光标位置</button>
    <script>
    function GetCurPos()
    {
      edit1.focus();
      var SaveStr=edit1.value;
      document.execCommand('paste','','pos'+SaveStr);
      var pos=edit1.value.indexOf('pos'+SaveStr);
      edit1.value=SaveStr;
      return pos
    }
    </script>
      

  2.   

    看看
    http://www.csdn.net/develop/add_article.asp
    也许会对你有帮助!!
      

  3.   

    这个比较简单。。给你个好玩的东西看看,是我自己编写的:
    <html>
    <head>
    <style type=css/text>
      #aa{
            margin-left: 400;
            margin-top: 200;
            background-color: #ffffff;
       }
    </style>
    </head>
    <body>
    <form name=f>
    <input type=button name=a id=aa>
    <input type=button name=b>
    </form>
    <script language=JavaScript>
      function click()
     {
      document.f.a.value=event.clientX+","+event.clientY
      document.f.b.value=' ';
      while(document.f.b.value.charAt(event.clientX%80,event.clientX%80+1)!=' ')
         document.f.b.value+=' ';
    }
     document.onmousemove=click
    </script>
    </body>
      

  4.   

    别忘了,给我分数呀!
      其实,就是一个event.clientX 和 event.clientY,就可以取得鼠标的位置了。。
    当然,你也就知道,怎么取得文本矿的位置了