You can download the completed functionality here:
This meets the following requirements:
1.) Create three drop down menus dynamically
2.) Use one method to create each menu based on the selection from the previous menu.
3.) Ability to start over at any time
4.) Use of cookeis and local storage
5.) Change background after last selection
When you open the page and enter your name, go ahead and test it by selecting Mammals -> Rare -> Samuel
I didn't have any of the images, so I put a "samuel.jpg" in the img folder for testing. You will see that it successfully sets the background. Place your images into the img folder to make it work with the images designated in the data file.
I had to alter the data file to use a better relational structure. While your animal objects had array elements that specified what group they belonged to, that is not a good or easy way of implementing this. Seaching the indexof on every single animal in all options everytime a selction is made.
Instead of that, I restructured the data file to use a heirarchical data structure. In this way, the animals have an actual physical relationship to the elements in which they belong. It is easy to list the mammals that are extinct because those animals belong to the extinct object within the mammals object. We can point directly to them instead of searching the entire data structure for them.
So, that meets all of the requirements that you listed. Let me know if you have any questions. I'm here to help.
Please remember to rate my answer. Thank you so much!