2

I'm searching a possibility to get an array of elements in E4X for an unknown tagname (like the DOMs getElementsByTagName) inside of a function.

My first thought was something like:

(function (doc, tag) {
    return doc..[tag];
})

Is there any chance to do this?

4

1 に答える 1

2
doc.descendants(tag);

And there's always eval :)

var query = "doc.." + tag;
eval(query);
于 2010-06-25T15:05:41.687 に答える