title: Use javascript to count immediate child elements of an element
body: <p>I can get the count of all descendants of an element, but I can't seem to target just the <em>immediate</em> children. Here's what I have at the moment.</p>
  
  <pre><code>var sectionCount = document.getElementById("window").getElementsByTagName("section").length;
  </code></pre>
  
  <p>I've played with other stuff and different syntax, but I can't seem to get it.</p>
  
  <p>The jQuery equivalent would be:</p>
  
  <pre><code>var sectionCount = $("#window &gt; section").length;
  </code></pre>
  
  <p>But I need to do this javascript only.</p>