Removal of divs that do not contain other divs

Removal of divs that do not contain other divs

Hi All,

I'm am trying to target an empty set of divs & remove them (.stacks_out) & everything inside of them.  Note there are others similar, but they have divs inside the comment lines.

Typ. divs I want to remove:
  1. <div id="stacks_out" class="stacks_out">
  2.   <div id="stacks_in" class="stacks_in">
  3.     <!-- comment line -->
  4.     <!-- another comment line -->
  5.   </div>
  6. </div>


  1. $('.stacks_out').each(function() {
  2.   if ($(this).children().not(":has('div[class^="searcher"]')")) {
  3.     $(this).remove();
  4.   }
  5. });

It seems to be removing other similar divs that I don't want touched.
I guess my selector is malformed some how?

Thanks,  Bill