http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/rowindex.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/sourceindex.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/cellindex.asp

解决方案 »

  1.   

    可是怎样知道rowindex和cellindex的具体值呢?
      

  2.   

    在状态栏显示.<table border> 
    <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> 
    <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> 
    <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> 
    <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> 
    <tr><td>Click and look statusBar</td><td>Click and look statusBar</td><td>Click and look statusBar</td></tr> 
    </table> 
    <script> 
    function document.onclick(){ 
    var e=window.event.srcElement 
    if(e.tagName=="TD"){ 
    window.status="第"+(e.parentElement.rowIndex+1)+"行,第"+(e.cellIndex+1)+"列" 


    </script>
      

  3.   

    function get()
    {
      if(event.srcElement.tagName.toLowercase() == "td")
      {
          alert(event.srcElement.cellIndex);
          alert(event.srcElement.innerText);
          alert(event.srcElement.parentNode.rowIndex);
      }
    }
    <td onclick=get()>sdfsdf</td>