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:
- <div id="stacks_out" class="stacks_out">
- <div id="stacks_in" class="stacks_in">
- <!-- comment line -->
- <!-- another comment line -->
- </div>
- </div>
- $('.stacks_out').each(function() {
- if ($(this).children().not(":has('div[class^="searcher"]')")) {
- $(this).remove();
- }
- });
It seems to be removing other similar divs that I don't want touched.
I guess my selector is malformed some how?
Thanks, Bill