I'm displaying data from an array of objects but I want to filter the results so that I display only the names of those objects that have a winner property with a value of 1.
<script>
$(document).ready(function () {
var json = [
{"name":"Name 1","winner":"1"},
{"name":"Name 2","winner":"0"},
{"name":"Name 3","winner":"1"},
{"name":"Name 4","winner":"1"},
{"name":"Name 5","winner":"0"},
];
var li;
for (var i = 0; i < json.length; i++) {
li = $('<li/>');
li.append(json[i].name);
$('#feed').append(li);
}
});
</script>
HTML should be like this (showing only results when winner is true, winner=1)
<ul id="feed" >
<li>Name 1</li>
<li>Name 3</li>
<li>Name 4</li>
</ul>
<font>tag ?