Let\'s say I have an unordered list, like this:
- Bald Eagle
- Falcon
- Condor<
You can also do this. It works as follows:
elements) and return them as a NodeList
element)Code:
const birdsContainer = document.getElementById("birds");
const birdList = birds.getElementsByTagName("li");
[].slice.call(birdList)
.reverse()
.forEach(bird => birdsContainer.appendChild(bird));