0
I researched other similar questions, but their answers didn’t help me because, the selector I’m using is different.
want to catch a tr
in a tbody
of a table
, using the selector nth-child(n)
but in the n
I want to put a variable and do more or less like this:
$("tbody").find("tr:nth-child(' + posicao + ')").addClass("classe");
this way is not working, and nor of others that I tried and saw in the answers here.
Try using the jQuery function specific to this, the
.eq(n);
- Would look like this$("tbody").find("tr").eq(suaVariavel).addClass("foo");
– dsantoro
@dsantoro and the response? :)
– Sergio
It was just a suggestion not worth as an answer rs.
– dsantoro