Thanks Dave I think you may be on to something. I think $("*:has(> div.someClass)") would work. Won't be fast, but that's not a concern. I'll give it a shot tomorrow.
On Oct 21, 12:40 pm, Dave Methvin <dave.meth...@gmail.com> wrote: > > Is there anyway to write a custom filter which returns the parent > > nodes of the selector? ie) div.someClass:parentNode or ancestor: > > div.someClass would return the parent element of div.someClass. > > Not that I know of, but you might be able to use the :has selector if > you know enough about the structure of the document. > > $("div.otherClass:has(div.someClass)") > > This might take some tweaking since it may return parents of parents.