I have been using jQuery’s find method and it’s been very useful.
However, I came across an example where the find seemed to be duplicating things and not returning elements in the order they appeared in the document. (I’m not sure if find is supposed to do this – I doubt it).
However, it shouldn’t have duplicates in the elements it finds and show the wrong order, surely?
Full example can be found here: jsFiddle – Notice how span[9] and span[10] are in the wrong order and duplicated.
Why is this the case?
Update
Updated so that output is written to document, please use new link above.
.find()returns elements in document order. More info here: http://docs.jquery.com/Release%3ajQuery_1.3.2I think the anomaly has something to do with the wildcard selectors. Are those necessary? Removing them seems to resolve the issue.