title: jQuery select descendants, including the parent
body: <p>Consider the following HTML:</p>
  
  <pre><code>&lt;div class="foo" id="obj"&gt;
     I should be changed red
     &lt;div class="bar" style="color:black;"&gt;
        I should not be changed red.
        &lt;div class="foo"&gt;I should be changed red.&lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Given a DOM element <code>obj</code> and an expression, how do I go about selecting any children and possibly <code>obj</code>?  I'm looking for something similar to "select descendants" but also including the parent, if it matches the expression.</p>
  
  <pre><code>var obj = $("#obj")[0];
  
  //wrong, may include siblings of 'obj'
  $(".foo", $(obj).parent()).css("color", "red");
  
  //wrong -- excludes 'obj'
  $(".foo", obj).css("color", "red");
  
  //correct way, but it's annoying
  var matches = $(".foo", obj);
  if ($(obj).is(".foo")) matches = matches.add(obj);
  matches.css("color", "red");
  </code></pre>
  
  <p>Is there a more elegant solution to this?</p>