Thanks Mauricio for the idea, but that code did not work, but I think I understand where you were going with it.
In the spirit of sharing and for anyone who is interested I figured this out: http://jsbin.com/eneyu/edit $('.location:not(:has(.trip:visible))').hide(); (or you could add a class of .hide if you want to keep the css out of the markup)