I have this array tv, when I read this array with a loop for, it just give me the last item, in this case Toshiba,
how can I do to it show me the TV brands??
for (var i=0;i<tv.length;i++){
$('#item').html(tv[i].Brand)}
<div id='item'></div>
Array tv:
var tv = [{"Name":"TV","Brand":"Samsung"},
{"Name":"TV","Brand":"Toshiba"},
{"Name":"TV","Brand":"LG"}]
html()overwrites the content on each iteration, that’s why only the last one is visible, the others are overwritten. You should be using append: