We use jQuery to parse some HTML. I then need to traverse that document and find some elements. Among the elements I need to find, there are the el
Like @pimvdb pointed, this don't work:
alert($("Test").find("link").text());
The explanation is right:
Sizzle uses context.getElementsByTagName, which fails because the elements are not in the DOM.
But this way work:
alert(("link", $("Test")).text());
And for some guys that said the second isn't working: http://jsfiddle.net/ErickPetru/5Qs3M/. But of course it obviously don't find elements that aren't on the DOM (i.e. on the head).