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
2 Respostas
+ 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 ^^
+ 1
porque en lugar de:
ul.getidol.appendChild(li1);
no usas:
getidol.appendChild(li1);
o
ul.appendChild(li1);