title: Counting number of elements with specific ID pattern
body: <p>I would like to use javascript to count all  elements that have ID pattern like:</p>
  
  <blockquote>
    <p>"Q"+Number</p>
  </blockquote>
  
  <p>and return the result into a text field "result".</p>
  
  <p>Say, we have the following example:</p>
  
  <pre><code>&lt;div&gt;
      &lt;div id="Q01"&gt;
          &lt;p&gt;Some text&lt;/p&gt;
      &lt;/div&gt;
      &lt;div id="Q02"&gt;
          &lt;p&gt;Some text&lt;/p&gt;
      &lt;/div&gt;
      &lt;div id="Q03"&gt;
          &lt;p&gt;Some text&lt;/p&gt;
      &lt;/div&gt;
  
          &lt;label for="number"&gt;Number of DIVs:&lt;/label&gt;
          &lt;input type="number" name="result" id="number"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>