24 lines
1.0 KiB
Markdown
24 lines
1.0 KiB
Markdown
To Do List
|
|
==========
|
|
|
|
When it comes to learning new web languages, the todo list has become a "Hello World". So expect to revisit this in Python.
|
|
|
|
But until then, we will do it in front-end Javascript.
|
|
|
|
You will find the toDoList prototype and constructor at the top of the main.js file.
|
|
|
|
###Create the List
|
|
|
|
The add method adds a todo to the list, using the text input and form.
|
|
|
|
The complete method marks the appropriate todo item complete. The user wants to click the item itself and strike the item, noting it done.
|
|
|
|
Use toggle to toggle it done struck and unstruck.
|
|
|
|
Feel free to add any other methods, lists or objects you may want. You will want a separate function to print the list to the #printout div.
|
|
|
|
###Woah! Client's demands have changed
|
|
|
|
Now the client who was going to buy your sweet todo list wants a new feature. Is it going to break your whole code, or is your code modular and extendable?
|
|
|
|
They want it so after a user completes a task, it is displayed struck for 10 seconds, but then disappears from your list. Google the setTimeout method. |