title: Delete parent div if child with class is present, without deleting other instances
body: <p>I need to remove a div from the DOM if it has a child div with a specific class name, without removing the child div.</p>
  
  <p>I tried using .remove() within an if/then statement, but when I do that it still removes all the instances of the targeted parent div, even those without the child.</p>
  
  <p>The parent and child-type-B classes are automatically generated.</p>
  
  <pre><code>&lt;div class="overall"&gt;
     &lt;div class="parent"&gt;
        &lt;div class="child-type-A"&gt;
           // stuff that can't be deleted
        &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="parent"&gt;
        &lt;div class="child-type-B"&gt;
           // more stuff
        &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="parent"&gt;
        &lt;div class="child-type-B"&gt;
           // even more stuff
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to remove the entire parent div if the child has class child-type-A, so it looks like this:</p>
  
  <pre><code>&lt;div class="overall"&gt;
     &lt;div class="child-type-A"&gt;
        // stuff that can't be deleted
     &lt;/div&gt;
     &lt;div class="parent"&gt;
        &lt;div class="child-type-B"&gt;
           // more stuff that can't be deleted
        &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="parent"&gt;
        &lt;div class="child-type-B"&gt;
           // even more stuff that can't be deleted
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is the jQuery I thought would work, but it does not (it removes all parents and children if child-type-A is present).</p>
  
  <pre><code>if( '.parent &gt; .child-type-A' ) {
   $( 'parent' ).remove();
  }
  </code></pre>
  
  <p>I would expect that the div targeted by the 'if' would be the only affected div, is there a way to do this?</p>