JavaScript JavaScript and the DOM Traversing the DOM Solution: Using nextElementSibling

down button doesn't work can someone help

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 48,730 Points

On line 27 of app.js you have nextElementSibling capitalized. It should be:

 let NextLi = li.nextElementSibling;
James Nguyen
PRO
James Nguyen
Pro Student 3,306 Points

the code in this lecture will not work because : let NextLi = li.nextElementSibling; then node.insertBefore() the NextLi so it is the same. You stand before your girlfriend and you say i want to stand before my girlfriend so everything is the same. But if you say I want to stand before the person after my girlfriend so that the same you stand right before that person but after your girlfriend. let afterNextLid = NextLi.nextElementSibling than parentNode.insertBefore(afterNextLi, li);