title: How to add a class to element if another element is empty?
body: <p>I am trying to remove the existing class (blue) and add a new class (red) to the &lt;'h2'> when the &lt;'a'> is empty.</p>
  
  <pre><code>&lt;div id="heading" class="header"&gt;
     &lt;h2 id="title" class="blue"&gt;Header text goes here&lt;/h2&gt;
     &lt;a class="info" href="#"&gt;&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;style&gt;
    .blue{color:blue}
    .red{color:red}
  &lt;/style&gt;
  </code></pre>
  
  <p>I have tried a few variations but without success. This is my latest.</p>
  
  <pre><code>$("#heading a.info:empty").removeClass('blue').addClass("red");
  </code></pre>
  
  <p>Any help on this would be appreciated.</p>