title: javascript array loop create element
body: <p>I am trying to create li elements based on the number of values in array.
  Basically, for every key in an array an li element needs to be created.</p>
  
  <pre><code>&lt;ul class="alpharow"&gt;
  &lt;/ul&gt;
      $(".alpharow").each(function() {
  
      var alpha = new Array();
          alpha['this'] = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
          alpha['that'] = ['l', 'm', 'n', 'o', 'p', 'q', 'r'];
       var n = alpha.length;
  
          for (i = 0; i &lt; n; i++) {
              //$("li:eq(" + i + ")");
  
             var li_tag = '&lt;li class="alpha_li"&gt;&lt;/li&gt;';
          }
  
          $(".alpharow").append(li_tag);
  
          //$("span").text("There are " + n + " kys.");
  
      });
  </code></pre>
  
  <p>So, a, b, c etc...would all have their own <code>&lt;li&gt;</code></p>
  
  <p>Thanks for the help, let me know if something is not clear.</p>