title: How to count the number of anchor tags within a div using javascript?
body: <p>I want to know how to count the number of anchor tags present within a <code>div</code> element.
  e.g.:</p>
  
  <pre><code>&lt;div&gt;
  &lt;a href="1" &gt;1&lt;/a&gt;
  &lt;a href="2" &gt;2&lt;/a&gt;
  &lt;a href="3" &gt;3&lt;/a&gt;
  &lt;a href="4" &gt;4&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How many <code>&lt;a&gt;</code> tags?</p>