We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afc3cea commit c4bf26dCopy full SHA for c4bf26d
projects/6-to-do-list/index.html
@@ -33,6 +33,7 @@ <h1>Too Doo List</h1>
33
<button id="btn-submit" type="submit">Add to do</button>
34
</form>
35
<ul id="todo-items" class="todo-list"></ul>
36
+ <a href="#" id="clear-todos">Clear my too doo list</a>
37
</div>
38
39
projects/6-to-do-list/js/to-do.js
@@ -37,6 +37,14 @@ var validateToDo = function(event) {
}
};
40
+var clearToDos = function(event) {
41
+ event.preventDefault();
42
+ window.localStorage.clear();
43
+ location.reload();
44
+ return false;
45
+};
46
+
47
+document.getElementById('clear-todos').addEventListener('click', clearToDos, false);
48
49
document.getElementById('btn-submit').addEventListener('click', validateToDo, false);
50
0 commit comments