Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. document.getElementById('add').onclick = function () {
  2. var d = document.getElementById('in').value;
  3. var temp = {};
  4. temp.todo = d;
  5. temp.checked = false;
  6. todoList.push(temp);
  7.  
  8. var newEl = document.createElement('div');
  9. for (let i = 0; i < todoList.length; i++) {
  10. const now = todoList[i].todo;
  11. const ck = todoList[i].checked;
  12. const ht = `
  13. <div>
  14. <label class="checkbox-container">
  15. ${now}
  16. <input type="checkbox">
  17. <span class="checkmark"></span>
  18. </label>
  19. <div></div>
  20. </div>`;
  21.  
  22. newEl.innerHTML = ht;
  23.  
  24. list.appendChild(newEl);
  25. };
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement