title: JQuery.val( ) not working
body: <p>I am trying to simply get the value of an input, and attach it to a 'zipcode' variable. However whenever I try to console the value, it just comes up as blank.</p>
  
  <pre><code>$(document).ready(function(){
    var zipcode = $('.zipcode-search').val()
  
    $('#button').on('click', function(){
      console.log(zipcode)
    })
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="col-sm-12"&gt;
      &lt;div class="text-center"&gt;
          &lt;input class="text-center zipcode-search" type="text" name="zipcode-search" placeholder="Enter your city"/&gt; 
          &lt;button id="button" class="btn btn-success"&gt;
            Submit
          &lt;/button&gt;
  </code></pre>
  
  <p>I am doing this on codepen.io. I'm not sure if that would have anything to do with it but I thought I might add that. Is there any other way besides .val() to get the value of an element ?</p>