text: initializeEvents();
  
  function initializeEvents(){
    document.querySelector('form.todolist').addEventListener('submit',Submit);
    document.querySelector('ul.todolist').addEventListener('click',Update);
  }
  
  function Submit(e){
      e.preventDefault();
      let input = document.querySelector('input');
      if(input.value != '')
        AddTask(input.value);
      input.value = '';
  }
  
  function AddTask(task){
      let ul = document.querySelector('ul.todolist');
      let li = document.createElement('li');
      li.innerHTML = `<span class="delete">×</span><input type="checkbox"><label>${task}</label>`
      ul.appendChild(li);
      document.querySelector('div.todolist').style.display = 'block';
  }
  
  function Update(e){
      if (e.target.className == "delete") {
          Delete(e);
      }
      else {
          Completed(e);
      }
  }
  
  function Completed(e){
      const task = e.target.nextSibling;
      if (task != null){
          if(e.target.checked){
              task.style.textDecoration = "line-through";
              task.style.color = "green";
          }
          else {
              task.style.textDecoration = "none";
              task.style.color = "black";
          }
      }
  }
  
  function Delete(e){
      let remove = e.target.parentNode;
      let parentNode = remove.parentNode;
      parentNode.removeChild(remove);
  }
  