title: Loop through array and match items to html elements
body: <p>I am looking for a more intuitive way to run the code below (as it is also incomplete to my purpose).</p>
  
  <pre><code>for (j = 0; j&lt;items.length; j++) {
              var indivItem = items[j];
                 if (indivItem.category == 1) {
                    $('.indiv_category[idnumber="1"]').append('&lt;ul class="left_side_item"&gt;&lt;li&gt;'+indivItem.title+'&lt;/li&gt;&lt;/ul&gt;');
                 }
                 else if (indivItem.category == 2) {
                    $('.indiv_category[idnumber="2"]').append('&lt;ul class="left_side_item"&gt;&lt;li&gt;'+indivItem.title+'&lt;/li&gt;&lt;/ul&gt;');
                 }
              }
  </code></pre>
  
  <p>Essentially I need line 3 to check <code>if (indivItem.category &gt; 0)</code> then look for the element with a matching <code>idnumber</code> attribute and append the necessary info.</p>
  
  <p>I need this continue for the length of available <code>.indiv_category</code> elements.</p>
  
  <p>Basically a matchup of the all items in the 'items' <code>array</code> to all of the elements with a matching 'idnumber' attribute to the item in the array that contains the same id number.</p>