lax
lax

Reputation: 518

span id getting undefined

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'));
        });

//I have to find span id on click of cell having rowIndex and colIndex respectively. getting me undefined

Upvotes: 0

Views: 172

Answers (1)

Nathan Villaescusa
Nathan Villaescusa

Reputation: 17649

Remove the .eq(rowIndex).

alert($('.csstextheader').find('td').eq(colIndex).find('span').attr('id'));

Upvotes: 2

Related Questions