title: todos list with a saved array and then retrieve it stuck?
body: <p>i started an app todoslist , after creating first code simply of adding new todos in DOM
  now my task is this :
  addtodo  :
  // grab todo value
  // pu tit in the array
  // tell the draw method to redraw the todos</p>
  <p>drawtodo :
  grab the array
  for each text add a todo entry in the documen</p>
  <p>the array
  my html code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
    &lt;title&gt;TodoList&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div class="todolist_box"&gt;
      &lt;h3&gt; To Do List &lt;/h3&gt;
      &lt;div class="input"&gt;
        &lt;input type="text" id ="inp" placeholder="Add new Task"&gt;
        &lt;button onclick="newTodo()" &gt;&lt;i&gt; enter &lt;/i&gt;&lt;/button&gt;
        &lt;button onclick="newTodo()" &gt;&lt;i&gt; save &lt;/i&gt;&lt;/button&gt;
        &lt;button onclick="drawtodo()" &gt;&lt;i&gt; load &lt;/i&gt;&lt;/button&gt;
  
      &lt;/div&gt;
      &lt;ul id="myUL"&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;script src="script.js" type="application/javascript"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>and this is my javascript code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function newElement() {
    // this code doesn't work, but it gives you an idea
    const li = document.createElement("li")
    const newEntry = document.getElementById("inp").value
    const u = document.createTextNode(newEntry)
    li.appendChild(u)
    document.getElementById("myUL").appendChild(li)
    document.getElementById("inp").value = "Nothing"
    // something like thi
    let todos = [] 
    
    function newTodo() {
      let inpvalue = document.getElementById('inp').value 
      todos.push(inpvalue)
      // trigger draw event
    }
  
  
    function drawtodo() {
      for (var i = todos.length - 1; i &gt;= 0; i--) {
        let li = document.createElement('li')
        let newlist = li.appendChild(document.createTextNode(todos[i]))
        inpvalue.appendChild(newlist)
          }
      
    }
  
    document.onload = function() {
      // this will excute when the document loads
    }
  }</code></pre>
  </div>
  </div>
  </p>