Advertisement
PadmaJS

Todo 2.0

Jul 15th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>TODO app</title>
  5.  
  6. </head>
  7. <body>
  8. <h2>ToDo List</h2>
  9. <input placeholder="Type Here" id="item">
  10. <button onclick="addItem()">Add</button>
  11. <div>
  12. <ol id="itemList">
  13.  
  14. </ol>
  15. </div>
  16. <script type="text/javascript">
  17. function addItem(){
  18. var item = document.getElementById("item");
  19. var newItem = document.createElement('li');
  20. newItem.textContent = item;
  21. var list = document.getElementById("itemList");
  22. list.appendChild(newItem);
  23. }
  24. </script>
  25. </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement