function addListElement(val) {
  var item = document.createElement("LI");
  
  // Create checkbox
  var check = document.createElement("INPUT");
  check.type = "checkbox";
  
  // Create trash can
  var close = document.createElement("IMG");
  close.src =
    "../images/trash.png";
  
  // Create span element to contain input text
  var task = document.createElement("SPAN");

  task.textContent = val.value;
  check.className = "done";
  close.className = "trash";

  item.append(task);
  item.append(check);
  item.append(close);

  todo.appendChild(item);
  val.value = "";
}
// Create function to add list elements to page
Create function to add list elements to page
Create function to add list elements to page
function addListElement(val) {
  var item = document.createElement("LI");
  var check = document.createElement("INPUT");
  check.type = "checkbox";
  var close = document.createElement("IMG");
  close.src =
    "../images/trash.png";
  var task = document.createElement("SPAN");
  task.textContent = val.value;
  check.className = "done";
  close.className = "trash";
  item.append(task);
  item.append(check);
  item.append(close);
  todo.appendChild(item);
  val.value = "";
}
function addListElement ( val ) { var item = document . createElement ( "LI" ) ; var check = document . createElement ( "INPUT" ) ; check . type = "checkbox" ; var close = document . createElement ( "IMG" ) ; close . src = "../images/trash.png" ; var task = document . createElement ( "SPAN" ) ; task . textContent = val . value ; check . className = "done" ; close . className = "trash" ; item . append ( task ) ; item . append ( check ) ; item . append ( close ) ; todo . appendChild ( item ) ; val . value = "" ; }
Create function to add list elements to page
Create function to add list elements to page
// Create checkbox // Create trash can // Create span element to contain input text