> 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.