Go to project: To Do list
You know some of the little things in your every day life that annoys you? Not much, just a little? Well some of them are stuff like not having an easy way to share to-dos and shopping lists with my boyfriend.
The first step for me was to do a simple to-do list. The sharing and syncing part will come later.
I’ll tell you this much, I think I was having a bad day on this one. My brain totally stopped working after trying to hook up the “add to list” button. So I called in backup, in the only form I know; the BF. And of course he helped me!
Lessons for this one:
- I think the most important function I made was the updateHTML function. The function in it self isn’t that complicated I think, but the mindset was really hard to grasp. Every time something changed the HTML had to be updated. I don’t know why I found this so hard to understand, but it does make sense. Now. Haha.
- Because every list element has the same functions (delete and done buttons), I had to figure out a way to tell which of the list elements that was being deleted or done. The BF and I went through all the events connected to button click function, and one of them is something called dataIndex. It gives a number and tells which number the element being clicked on is in the list. Ie. number 2, 1 etc. That way it can be styled.
- Also when we made the delete button we actually had to tell the array to delete the element from the array. Apparently there is a function called .splice (I LOVE that name! It’s too funny!) that removes the element from the array.