Answer the question
In order to leave comments, you need to log in
How to display an array in a div?
Hey!
There is such an example - https://jsfiddle.net/b2z3L760/1/
const arr = [
{id: 850, name: 'hello'},
{id: 851, name: 'world'},
{id: 852, name: 'hello'},
{id: 853, name: 'john'},
{id: 854, name: 'putin'},
];
arr.forEach(item => {
$('.list').append(`
<span class="green" id="${item.id}">${item.name} id:${item.id}</sapn>
`);
});
arr.splice(3, 1);
arr.push({id: 888, name: 'rov'});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question