title: Javascript - How to get star rating from object array field rating?
body: <p>I have this object array:</p>
  
  <pre><code>var test_data = [    
                  {
                      "id" : "Test01", //Has to be a string form ID
                      "test_info"  : "This is the test information",
                      "test_rating" : 5
                  },
                  {
                      "id" : "Test02", //Has to be a string form ID
                      "test_info"  : "This is the test information",
                      "test_rating" : 2
                  }
  </code></pre>
  
  <p>As it stands I am using the following to populate a unordered list (but it is only populating the id)</p>
  
  <pre><code>fieldOutputId.forEach(function(id) {
      $("#idList").append('&lt;li&gt;&lt;a href="#"&gt;' + id +" "+ "&lt;/a&gt;&lt;/li&gt;"); 
  });
  </code></pre>
  
  <p>I am wondering how to get Stars appearing to the right with the value of <code>test_rating</code> that's stored in <code>fieldOutputRating</code> like showing up like this picture (Stars being the red text)</p>
  
  <p>Fig1 :<a href="https://i.stack.imgur.com/Y0eBj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y0eBj.png" alt="Star Rating"></a></p>
  
  <p><strong>-----EDIT-----</strong></p>
  
  <p>Thanks to @ChrisG this gets it inline, id &amp; test_rating:</p>
  
  <pre><code>test_data.forEach(function(item) { $("#idList").append('&lt;li&gt;&lt;a href="#"&gt;' + item.id+ '&lt;/a&gt;&lt;div class="fa fa-star"&gt;'+ item.test_rating+ "&lt;/div&gt;&lt;/li&gt;"); })
  </code></pre>
  
  <p>With the above code I am trying to get the stars to appear in-line (done) and as stars using font-awesome library with a <code>class="fa fa-star</code></p>
  
  <p>This is what the above is giving:</p>
  
  <p><a href="https://i.stack.imgur.com/7uzJl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7uzJl.png" alt="Not Working Star Rating"></a></p>
  
  <p>So its getting the test_rating but not giving any stars for it. 
  Any help is appreciated??</p>