Backing up set to get those not previously selected

Backing up set to get those not previously selected

I'm sure this is simple.

Consider:

  1. <div>
  2.       <div id="goodpage1">
  3.       </div>
  4.       <div id="goodpage2">
  5.       </div>
  6.       ...
  7.       <div id="badpage1">
  8.       </div>
  9.       <div id="badpage2">
  10.       </div>
  11.       ...
  12. </div>
I wish to show the good pages and hide the bad pages.

Can I get a set of those with 'good' in the id, show them, then somehow get a set of the elements that weren't showed so I can hide them, or must I now explicitly search for those with 'bad' in the id (or not 'good')?