获取行号列号


input的行号列号
alert("A行号:"+obj.parentNode.parentNode.rowIndex+" A列号:" +obj.parentNode.cellIndex +" type:"+obj.type);


点击td触发获取行号列号
$("#tab1 td").click(function () {
//alert("bbbb");
      tdSeq = ($(this).parent().find("td").index($(this)[0]))+1;
      trSeq = ($(this).parent().parent().find("tr").index($(this).parent()[0]))+1;
      alert("AtdSeq:"+tdSeq+" trSeq:"+trSeq);
      //alert("bbbb:"+tdSeq);
      return;
//alert("123第"+(trSeq)+"行,第"+(tdSeq)+"列的值是:"+rows[trSeq].cells[tdSeq].innerHTML);
     });

猜你喜欢

转载自helyhu.iteye.com/blog/1593045