Completing this assignment depends on knowing:
- basic JavaScript to create variables, work with arrays, if/else statements and for loops
- methods for working with the DOM Tree
- methods for adding and removing attributes DOM elements
https://github.com/htc-ccis2591/grocery-list
You’ll want to begin each assignment by forking the repository and cloning it locally. When you are done, you’ll push to GitHub and submit a pull request.
Open the web page in a browser. You should see a short grocery list.
Write JavaScript to get all the list items (get them by tag name) and loop through all of them. For each list item, log the text to the console and then remove the list item.
When the list is empty, get the unordered list element by id, then add a new list item that says "Bought all the groceries."
When you are done, push your files to GitHub, then make sure that your page displays and runs correctly on the GitHub website.
Don't forget the Pull Request. Put a screenshot of the open request in the assignment dropbox.