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
2 odpowiedzi
+ 2
Didn't you post this problem and get an answer already?
https://www.sololearn.com/Discuss/2704331/?ref=app
+ 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 ^^