this.rowIndex不行...这个属性只能在<tr alert(this.rowIndex)>
放在button里就不行了

解决方案 »

  1.   

    jf   jf
     jf jf
      jf
      

  2.   

    <input type="button" value="删除" onclick="delRow(this)"> 
    function GetTR(tdch)
    {     
        var mytable;
        if(tdch.tagName!="TR")
        {
            mytable=tdch.parentElement;
            mytable=GetTR(mytable);
        }
        else
        {
          mytable=tdch;
        }
        return mytable; 
      } function delRow(e)
      {
         var tr=GetTR(e.parentElement);
         tr.parentElement.removeChild(tr);
         addint=0;
         
      }
      

  3.   

    onclick="delRow()"function delRow() {  
    var obj=event.srcElement.parentNode;
    while(obj.tagName!="TR") obj = obj.parentNode;
    obj.removeNode(true);
    }
      

  4.   

    onclick="delRow(this)" function delRow(o) {
        while(o.tagName!="TR") o = o.parentNode;
        o.removeNode(true);
    }
      

  5.   

    onclick="delRow(this)"  function delRow(o) { 
        while(o.tagName!="TR") o = o.parentNode; 
        o.parentNode.removeChild(o); 
    }
      

  6.   

    楼上的
    while可以不要吧,
    this.parentNode.rowIndex  
      

  7.   

    灌水机代码:www.dullwolf.cn/CSDNer.rar下载。