title: JSON array to concatenated string
body: <p>I'm reading a JSON file which contains information about a number of users.</p>
  
  <pre><code>{
  "SRM": [{
      "title": "Firstname Surname",
      "image": "firstname",
      "subtitle":"the subtitle"     
  }, {
      "title": "Firstname Surname",
      "image": "firstname",
      "subtitle":"the subtitle" 
  }, {
      "title": "Firstname Surname",
      "image": "firstname",
      "subtitle":"the subtitle" 
  }]
  </code></pre>
  
  <p>}</p>
  
  <p>The first part is working fine, in getting their details and building my HTML like so.</p>
  
  <pre><code>        $.getJSON("srm.json", function(data) {
          var i = 1;
          $.each(data.SRM, function(key, val) {
  
                   $("#image"+i).attr("src", "custom/img/who/"+val.image+".jpg");
                   $("#bioimage"+i).attr("href", "custom/img/who/"+val.image+"b.jpg");
                    $("#title"+i).html(val.title);
                     $("#subtitle"+i).html(val.subtitle);
                   i = i+1;
  
          });
  
  
      });
  </code></pre>
  
  <p>However I have now introduced tags, which will act as filters.</p>
  
  <pre><code>{
  "SRM": [{
      "title": "CHETNA SHARMA",
      "image": "chetna",
      "subtitle":"SERVICE RELATIONSHIP MANAGER",
      "tags":["1","2","3"]
  }]
  </code></pre>
  
  <p>}</p>
  
  <p>I can't figure out how to correctly read these back so that I can add them all to the class of a user.</p>
  
  <p>for example the above tags should add them like so</p>
  
  <pre><code>    &lt;div id="thetags" class="cbp-item 1 2 3"&gt;
  </code></pre>
  
  <p>any pointers on how best to read out the whole tags array correctly? thanks</p>