title: Apply style to parent based on property on child, with jQuery?
body: <p>How do I apply a style to the parent of an element if it has a specific property? Here's the example I'm working with...</p>
  
  <pre><code>&lt;div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;div class="inner active"&gt;&lt;/div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
      &lt;div class="inner"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>...I want to apply a background color to the out div when its child element with an 'inner' class also contains the 'active' class. Here's the jQuery solution I hacked together, which doesn't seem to be working...</p>
  
  <pre><code>if ($("div.inner").hasClass("active")) {
      $(this).parent().css("background", "yellow");
  };
  </code></pre>
  
  <p>Does anyone have a fix, or better approach, in mind? Thanks.</p>
  
  <p>Also, optionally, how do I get it to apply the style based on specific text within the 'inner' div as opposed to a specific class being applied to it? Thanks again.</p>