title: How to select multiple elements that are children of given element?
body: <p>I have <code>&lt;div id='mydiv'&gt;</code> and I need to select all <code>pre</code> and <code>div</code> elements that are children of <code>#mydiv</code>.</p>
  
  <p>I could do it this way:</p>
  
  <pre><code>div#mydiv &gt; pre, div#mydiv &gt; div
  </code></pre>
  
  <p>but, can it be done so that <code>#mydiv</code> is referenced only once?</p>
  
  <pre><code>div#mydiv &gt; pre, div
  </code></pre>
  
  <p>will select all <code>div</code>s on the page regardless if they're children of <code>#mydiv</code>,  so the comma isn't a way to do it. Maybe there's another kind of syntax I don't know about?</p>