F
F
freeiji2011-04-29 21:44:51
JavaScript
freeiji, 2011-04-29 21:44:51

jQuery - select next two elements?

There is a table with N number of tr , when you click on the tr element , you need to select the next two tr elements .

Maybe there is a more elegant solution?

$(this).nextAll("tr:eq(0), tr:eq(1)");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TheAlien, 2011-04-29
@freeiji

Haven't tried it, but there is such a thing as :lt() Selector
Maybe something like "tr:lt(2)" will return the first 2 TR elements?
If I understand correctly how the selector works, of course.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question