On second thoughts, it looks like you want the div that contains the span but without the span in it? I think there is something wrong that your logic there, but depending on what you want to do something like this might work for you: $("div:has(span)").find("span").remove().end(); That will remove that span from the document, and leave you only with its containing div...
duck! wrote: > > $("div:not(span)"); will return all the divs in the document that are not > spans... all of them obviously > > You want all the divs that don't (:not()) contain (:has()) spans. > $("div:not(:has(span))"); > > hope this helps. > > > jquertil wrote: >> >> >> according to jquery documentation I should be able to select an >> element that is NOT something, i.e. exclusion. >> >> >> DOM: >> <div>hello there, how are you?</div> >> >> JQUERY SELECTOR: >> $('DIV :not(SPAN)') >> >> SHOULD RETURN: >> <div>hello you?</div> >> >> >> right? well, it's not happening for me... what am I dogin wrong? >> >> > > -- View this message in context: http://www.nabble.com/jquery-documentation-of-exlusion-pseudo-class-tp17569575s27240p17570530.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.