title: Javascript, remove class of DIV based on value of Link's innerHTML
body: <p>I am looking for some help with Javascript. I have a piece of HTML as follows:</p>
  
  <pre><code>&lt;div class="KeepShopping FloatRight GreenButton"&gt;
      &lt;a href="http://www.xyz.com"&gt;Click here to keep shopping&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am trying to remove class "GreenButton from the DIV once the link inside it has no text in the HTML, so the end result should look like this:</p>
  
  <pre><code>&lt;div class="KeepShopping FloatRight"&gt;
      &lt;a href="http://www.xyz.com"&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have been unsuccessfully trying to get this with the following code, which runs at end of page load/refresh:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;    
  $(".KeepShopping").each(function() {
      if($("a", this).html == "") {
          $(this).removeClass("GreenButtonLge");
      }
  });
  &lt;/script&gt;    
  </code></pre>
  
  <p>Any suggestions / ideas are really welcome! Thank in advance for any help!</p>