Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

can not render values of array (jquery)

hey i can not render all my values. i got 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 wil not refresh it and get stacked. what i want use is something like .text() or .html(). but i can not find the issue it wil 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>'));
    });

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You seem to be not appending them but instead overwriting them.

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

should append each one to the pre-existing html.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading