title: How to add options for 24 hours in 12 hour AM/PM format?
body: <p>How to display the below, using for loop in JavaScript?:</p>
  
  <pre><code>    &lt;option value="00"&gt;00 AM&lt;/option&gt;
      &lt;option value="01"&gt;01 AM&lt;/option&gt;
      &lt;option value="02"&gt;02 AM&lt;/option&gt; 
      .
      .
      .
      &lt;option value="21"&gt;09 PM&lt;/option&gt;
      &lt;option value="22"&gt;10PM&lt;/option&gt;
      &lt;option value="23"&gt;11PM&lt;/option&gt;
  </code></pre>
  
  <p>I have tried this so far:</p>
  
  <pre><code>for (var i = 0, j = 0; i &lt; 12, j &lt; 24; i++, j++) {
      console.log(this.addZero(i) + "AM");
      console.log(j);
      if (i &gt; 11) {
          console.log()
      }
      $("#fromHour").append("&lt;option value='" + this.addZero(i) + "'&gt;" + this.addZero(i) + "AM&lt;/option&gt;")
      $("#toHour").append("&lt;option value='" + this.addZero(i) + "'&gt;" + this.addZero(i) + "AM&lt;/option&gt;");
  }
  </code></pre>
  
  <p>After <code>i</code> is greater than <code>11</code> it should display <code>PM</code> and value should be incremented. </p>
  
  <p>How to do that?</p>