Select all td in tr using jQuery

How can I access all tds in tr, knowing only the tr index. I hope to do this with the nth-child jQuery selector.

+6
source share
3 answers
$("table tr:eq(5) td") 

This returns all td elements in the 6th row of the table

+12
source

The uber-speedy .eq filtering method is one way.

 var $cells = $("#table tr").eq(index).find("td"); 
+6
source
 $("table tr:nth-child(x) td"); 

This will return all td within the x you set

0
source

Source: https://habr.com/ru/post/889002/


All Articles