Skip to content

Instantly share code, notes, and snippets.

View nbeers22's full-sized avatar

Nathan Beers nbeers22

  • Jacksonville Beach, FL
View GitHub Profile
@nbeers22
nbeers22 / scripts.md
Last active April 3, 2019 08:26
shopping list pseudocode

Adding New Items

  1. When form is submitted, prevent form from refreshing and get value of input
  2. Add the new item to the STORE variable

Delete Item from list

  1. use click handler to determine which item was clicked using $(this)
  2. traverse up the DOM to the parent
  3. Grab the id in data-item-id to use to remove from the STORE
  4. use jQuery .remove() to remove the
  5. from the DOM completely