how to make a to do list in html

Solutions on MaxInterview for how to make a to do list in html by the best coders in the world

showing results for - "how to make a to do list in html"
Lea
12 Sep 2019
1<!DOCTYPE html>
2<html>
3 <head>
4 <title>To-Do List App</title>
5 <script>
6  function addItem() {
7   var newItem = document.createElement("div");
8   newItem.innerHTML = document.getElementById("box").value;
9   newItem.onclick = removeItem;
10   document.getElementById("list").appendChild(newItem);
11   saveList();
12  }
13  function removeItem() {
14   document.getElementById("list").removeChild(this);
15   saveList();
16 </script>
17</head>
18<body>
19 <div class="header">
20 </div>
21 <div class="app">
22  <input type="text" id="box" value="Type here to add task"/>
23  <br/>
24  <input type="button" value="Add item" onclick="addItem();"/>
25  <br/>
26   <div id="list"></div>
27 </div>
28</body>
29</html>