title: jQuery show div only if has class
body: <p>I have some problems with show/hide element. I have 2 popups on one page and I need hide one popup if another popup has class.
  For example:</p>
  
  <pre><code>&lt;body class="home"&gt;
    &lt;div class="popup main"&gt;&lt;/div&gt;
    &lt;div class="popup"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>So, if <strong>body.home</strong> has <strong>.main</strong> I need to show only <strong>.main</strong> popup and hide or remove another <strong>.popup</strong>.</p>
  
  <p>I'va tried </p>
  
  <pre><code>if ($('.home').find('.main')) {
       $('.home').find('.main').show();
       $('.home').find('.popup').remove();
  }
  </code></pre>
  
  <p>But it does not working as I need, because in some reason I'll have code only with one popup block</p>
  
  <pre><code>&lt;body class="home"&gt;
    &lt;div class="popup"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>