this is not a surprise... it is right in the docs: > http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN > "Note order of the dom elements in the jQuery object aren't > necessarily identical."
BUT, I need to match a handful of things and add to the first match in the DOM, e.g.: $('h2,h4,p,ul').eq(0).addClass('found-it'); unfortunately, it looks for all h2 THEN all h4 THEN all p THEN all ul, instead of scanning the dom for matches in the order of the DOM... So my question is: how would I achieve this: find the first match for multiple selectors, as it appears in the DOM? Thanks