title: Pushing values into an empty array?
body: <p>I'm recently new at programming and JavaScript. I'm not sure why this doesn't work. I'm trying to insert numbers into an empty array. And then have them displayed into the div with the id of "value".</p>
  
  <p>My JavaScript: </p>
  
  <pre><code>var array = new Array();
  // var array = [];
  
  $(document).ready(function() {
    $('#btn').on('click', function() {
      var $input = $('#input').val();
      array.push($input);
    });
    $('#value').text(array);
    console.log(array);
  });
  </code></pre>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;div id="number"&gt;
    &lt;input type="text" id="input"&gt;
    &lt;button id="btn"&gt; Submit &lt;/button&gt;
  &lt;/div&gt;
  </code></pre>