0

How Can i get ordered tree list item with my one unordered list with one list item top economic powers. Thanks you.

Get tree list item ordered with one unordered list item top economic powers. https://code.sololearn.com/WLdnO2BaI6od/?ref=app

22nd Feb 2021, 4:27 PM
Malick Diagne
Malick Diagne - avatar
2 Answers
+ 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
+ 1
porque en lugar de: ul.getidol.appendChild(li1); no usas: getidol.appendChild(li1); o ul.appendChild(li1);
22nd Feb 2021, 9:38 PM
Daniel Briceño
Daniel Briceño - avatar