Is there a way to select jquery elements based on their “generation”? For example, selecting all great-grandchildren of an element?
This is obviously wrong, but this is my line of thinking:
$('#mydiv' :4th-generation').click();
I couldn’t find anything in the jQuery docs or here at SO about it…
UPDATE: based on suggested results below, here’s a working proof of concept: http://jsfiddle.net/eZhEM/
Thanks for the guys who replied!
Something like this I suppose (untested):