jQuery
allows something like:
var divs = jQuery('div');
jQuery('a', divs);
Prototype
docs say:
$$('#navbar a', '#sidebar a');
// -> all links within the elements of ID "navbar" or "sidebar"
Which I took to mean that it is performing the same thing as this in jQuery: jQuery('#navbar a, $sidebar a');
So I guess the question is what should the marked line be:
var divs = $$('div');
var inner_spans = $$('span', divs); // * marked line
The
selectfunction as Diodeus listed, is what I think I was after.Really, the only bit I cared about was the
div.select('span'), pushing them into an array wasn’t really the goal here 🙂