0

My ordered list items is display first. Why? I do unordered list list item top economic powers first. Thanks you.

Display first unordered list top economic powers. https://code.sololearn.com/WLdnO2BaI6od/?ref=app

23rd Feb 2021, 4:12 AM
Malick Diagne
Malick Diagne - avatar
2 Réponses
+ 2
Didn't you post this problem and get an answer already? https://www.sololearn.com/Discuss/2704331/?ref=app
23rd Feb 2021, 4:33 AM
Ipang
+ 2
you have your <ol> inside your <ul>, so ul.appendChild(li) on <ol> will put <li> AFTER the still child <ol>... to 'prepend' <li> you should use: ul.insertBefore(li,ul.firstChild); ... if there's no childs, element is inserted as first child ^^
23rd Feb 2021, 5:29 AM
visph
visph - avatar