removeColor function is all over the place. Not sure why you’re creating an element there. That’s not necessary if you’re trying to remove something . Getting rid of that also fixes the re-used variable problem. It (
crayon) starts as a string you got from the user, but then you wipe it out, replacing it with the element you create.
What you need to do is find an existing element based on what you got from the prompt. In your HTML you have id values matching the colors, so you can use that to easily find elements to remove, but you’ll want to update your
addChildToTop function to set ids as well. Then, you just get the to-remove element using
document.getElementById(crayon) and run it through the remove code you already have.