Answers for "to do list in html"

1

how to make a to-do list in html

<!DOCTYPE html>
<html>
 <head>
 <title>To-Do List App</title>
 <script>
  function addItem() {
   var newItem = document.createElement("div");
   newItem.innerHTML = document.getElementById("box").value;
   newItem.onclick = removeItem;
   document.getElementById("list").appendChild(newItem);
   saveList();
  }
  function removeItem() {
   document.getElementById("list").removeChild(this);
   saveList();
 </script>
</head>
<body>
 <div class="header">
 </div>
 <div class="app">
  <input type="text" id="box" value="Type here to add task"/>
  <br/>
  <input type="button" value="Add item" onclick="addItem();"/>
  <br/>
   <div id="list"></div>
 </div>
</body>
</html>
Posted by: Guest on August-08-2021
1

how to make list in html

creats an organised list
<ol>
  <li>apple</li>
  <li>mango</li>
  <li>watermelon</li>
</ol>
creats an unorganised list
<ul>
  <li>apple</li>
  <li>mango</li>
  <li>watermelon</li>
</ul>
Posted by: Guest on March-06-2021

Browse Popular Code Answers by Language