Не удается вывести значения массива (jquery)

hey i can not render all my values. i have names (button) if i click these i will render the array behind it. if i use .append() it will render all of them but when i click again it will not refresh it and get stacked. what i want use is something like .text() or .html(). but i can not find the issue it will return always the first one in the array and the other values are not showing.

 var treinen =$("#treinenArray0");
    var list = data.info[0].kwalificaties;
    $.each(list, function(index, value){
       treinen.html($('<li>'+ value + '</li>'));
    });

Похоже, что вы не добавляете их, а перезаписываете.

treinen.html(treinen.html() + '<li>'+ value + '</li>'));

должен добавлять каждый из них к уже существующему html.

Вернуться на верх