SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top