[jQuery] Selecting parent ID
Hi everyone, I have a lot of tables, like this: table id=stuff1trtdlorem/tdtdipsum/td/table table id=stuff2trtdlorem2/tdtdipsum2/td/table I want to loop through all td:s and select the id of the parent table. What is the best solution for that? $('table td').each(function(){ // select the parent table id here $('parenttable').attr(id); }); Best regards, Christoffer
[jQuery] Selecting parent id
Hi everyone, I have a lot of tables, like this: table id=stuff1trtdlorem/tdtdipsum/td/table table id=stuff2trtdlorem2/tdtdipsum2/td/table I want to loop through all td:s and select the id of the parent table. What is the best solution for that? $('table td').each(function(){ // select the parent table id here $('parenttable').attr(id); }); Best regards, Christoffer