span id未定义

时间:2012-10-25 06:40:41

标签: jquery

fiddle

 $(".csstablelisttd").live('mousedown', function (e)
        {    var rowIndex = $(this).closest("tr").index();
           var colIndex = $(e.target).closest('td').index();
            alert($('.csstextheader').eq(rowIndex).find('td').eq(colIndex).find('span').attr('id'));
        });

//我必须分别找到包含rowIndex和colIndex的单元格的span id。 让我不确定

1 个答案:

答案 0 :(得分:2)

删除.eq(rowIndex)

alert($('.csstextheader').find('td').eq(colIndex).find('span').attr('id'));
相关问题