title: javascript map elements of an array to HTML DIV template
body: <p>What I'm looking for is either a function or a piece of code that could help me dump the results of an array into an HTML DIV. I know that there's different ways of doing so, but these all require iterating through the array. What I'm looking for is more like a mapping tool. For example:</p>
  
  <p>Let's imagine I have the following array in my javascript:</p>
  
  <pre><code>var myarray = [];
  myarray['name'] = 'value1';
  myarray['lastname'] = 'value2';
  myarray['address'] = 'value3';
  </code></pre>
  
  <p>What I'd like to do next is somehow associate each of those values of the array to their equivalents in an HTML DIV. For example:</p>
  
  <pre><code>&lt;div id="name"&gt;&lt;/div&gt;
  &lt;div id="lastname"&gt;&lt;/div&gt; 
  &lt;div id="address"&gt;&lt;/div&gt; 
  </code></pre>
  
  <p>Or EVEN better, I'd like to be able to have a table in my HTML that could be fetched with this information without using DIVs. Something like:</p>
  
  <pre><code>&lt;table width="277" height="146" border="1"&gt;
    &lt;tr&gt;
      &lt;td width="97"&gt;Name&lt;/td&gt;
      &lt;td width="87"&gt;{name}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Lastname&lt;/td&gt;
      &lt;td&gt;{lastname}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Address&lt;/td&gt;
      &lt;td&gt;{address}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>So the idea is that when I get the values in my Javascript (via jquery) I can write the whole content of the array to the HTML table without having to iterate through each of the values of the array. </p>
  
  <p>Any ideas if there's something out there that could help me achieve my goal?</p>