Kjetil-Lennart A. Lorentzen13,388 Points
Can't get my code to work. Can anybody take a look at it?
There's a snapshot of my code. I tried to keep it clean so it would be easy to read. I've tried making a function with a loop and if-statements to crawl over the buttons to make them disapppear. They do disappear, but! The last if-statement on line 61 doesn't add them again. I've been at this for a couple of days, decided to look at the video for the challange solution, but there wasn't any, haha.
I can't see the solution to this, i have no idea how to fix this, my frustration is clouding my thinking like you wouldn't believe. I appreciate the help, a solution to this would end my frustrations.
Steven Parker171,296 Points
It doesn't make sense for "firstChild" and "lastChild" to be global constants, since using the buttons will change the order of the items.
But if you assign them inside the "buttonCrawler" function, then it can correctly identify the items that need buttons to be made visible again.