Here is the JsFiddle code . It displays entries from Wikipedia, so the results are displayed from bottom to top. How to make sure that what is displayed below is displayed above?

I understand that the case in this line?

for (var i = 0; i < data[1].length; i++) { $('#output').prepend("<li><a href=" + data[3][i] + ">" + data[1][i] + "</a><p>" + data[2][i] + "</p></li>"); 
  • prepend adds an element to the beginning of the container, append - to the end - Grundy

2 answers 2

 for (var i = data[1].length - 1; i >= 0; i--) { $('#output').prepend("<li><a href=" + data[3][i] + ">" + data[1][i] + "</a><p>" + data[2][i] + "</p></li>"); } 
     $('#output').append("<li><a href=" + data[3][i] + ">" + data[1][i] + "</a><p>" + data[2][i] + "</p></li>"); 

    So?)