title: put array element value in span jquery
body: <pre><code>var data = [{"id":"2015-07-003","cname":"John Smith ","caddress":"Tokyo,Japan","ccontact":"123"},{"id":"2015-07-003","cname":"James Harden","caddress":"Osaka Japan","ccontact":"345"}]
  
  
  
  $.each(data, function(item, element) {
    alert(element.cname);
    $('#name').text(element.cname);
  });
  
  
  &lt;span id='name'&gt;&lt;/span&gt;
  </code></pre>
  
  <p>In above i want to put the names in the array inside the span but what is happening is only one name is shown the last one. Meaning the names is overriden how can i iterate the name so all can be shown</p>
  
  <p>I want it to look like</p>
  
  <pre><code>John Smith
  James Harden
  </code></pre>