title: Display javascript array in div
body: <p>I am trying to make a basic to do application.</p>
  
  <p>Here is what I have done so far;</p>
  
  <ul>
  <li><p>When the user clicks a button a prompt appears asking the user to enter a task.</p></li>
  <li><p>The task will then be stored in an array</p></li>
  <li><p>I have displayed the array in the console. However, I am having trouble displaying the array on the web page:</p></li>
  </ul>
  
  <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>var toDoItems = [];
  var parsed = "";
  
  document.getElementById("addItem").onclick = function() {
    var userInput = prompt("Enter your Todo: ")
    toDoItems.push = userInput;
    console.log(toDoItems);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
    &lt;link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,300italic' rel="stylesheet" type="text/css"&gt;
    &lt;link rel="stylesheet" type="text/css" href="css/style.css"&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;title&gt;To Do List&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;h1&gt;My Tasks&lt;/h1&gt;
    &lt;button id="addItem"&gt;Add item&lt;/button&gt;
    &lt;div id="item-list"&gt;
    &lt;/div&gt;
    &lt;script src="js/script.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>