JavaScript JavaScript and the DOM Traversing the DOM Using previousElementSibling and insertBefore

Rod R
Rod R
3,045 Points

my 'up' buttons are removing list items instead of moving up

I've reviewed the code multiple times and compared with the video, and there's no JS console error, but the UP buttons are removing items. Where's the error?

1 Answer

Daniel Baker
Daniel Baker
14,651 Points

Try == or ===?

//original line 13
 if ("remove") {

if ( == "remove") {

//You got it right in line 18
if ( == "up") {

I'm sure you know what the single = does from the rest of your code, so I am assuming you don't need me to explain that you are trying to assign "remove" to I am assuming it's just a typo.