title: Javascript To Do list app push to array/local storage
body: <p>I am trying to be able to add user input into an array. I cannot seem to figure out how to go about accomplishing this. I have spent hours trying to figure out exactly what to do. I also would like to have this "to do list" save to my local storage, I am equally frustrated with trying to figure out both of these issues.</p>
  
  <p>Any advice or guidance on how to add to the array from user input and/or how to put this into local storage would be greatly appreciated. It has taken me quite some time to even get thus far. Thank you for all of your help! Greatly appreciated.</p>
  
  <p>Javascript</p>
  
  <pre><code>var theList = [];
  
  function todoList() {
    var item = document.getElementById('todoInput').value;
    var text = document.createTextNode(item);
    var checkbox = document.createElement('input');
        checkbox.type = "checkbox";
        checkbox.name = "name";
        checkbox.value = "value";
    var newItem = document.createElement("li");
  
    newItem.appendChild(checkbox);
    newItem.appendChild(text);
    document.getElementById("todoList").appendChild(newItem)
  
    return clear();
  }
  
  function clear() {
    todoInput.value = "";
  }
  
  console.log(theList);
  </code></pre>
  
  <p>HTML</p>
  
  <p></p>
  
  <pre><code>  &lt;h1&gt;To Do List:&lt;h1&gt;
      &lt;input id="todoInput" type="text"&gt;
      &lt;button type="button" onclick="todoList()"&gt;Add Item&lt;/button&gt;
  &lt;/form&gt;
  &lt;ol id="todoList"&gt;
  &lt;/ol&gt;
  
  &lt;script src="todo.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p></p>