title: getJSON does not work on button click but does with hitting enter key
body: <p>My getJSON request and the rest of my function works fine if the user hits enter after filling out the field however my function does not get past the getJSON request if they click the search button. </p>
  
  <p>I've found some similar post on SO but haven't been able to fix my issue yet. I've tried adding .live before my .click event and also tried adding e.preventDefault in a couple different spots but that hasn't resolved it either. </p>
  
  <p>My HTML looks like this</p>
  
  <pre><code>&lt;input id="zipCode" maxlength="5" type="text"&gt; &lt;button id="zipSearch" onclick="findByZip()"&gt;Search&lt;/button&gt;&lt;/p&gt;
  </code></pre>
  
  <p>My JS looks like this </p>
  
  <pre><code>$(document).ready(function () {
      $('#zipSearch').click(findByZip);
  
      $('#zipCode').bind('keydown', function (e) {
  
          if (e.keyCode === 13) { // 13 is enter key
              e.preventDefault();
              findByZip();
              return false;
          }
      });
  }
  );
  
  function findByZip() {
      console.log('running findByZip');
      var zip = $('#zipCode').val();
      var stateName = $('#stateName');
      stateName.text("Reps for " + zip);
      $("#results").empty();
      var url='//something.com/api/Reps?Zipcode=' + zip;
      console.log(url);
      $.getJSON(url, function (data) {
      console.log(data);
      if (data.length == 0) {
      var header = "&lt;h3&gt;No matches found.&lt;/h3&gt;"
      $('#result').append(header);
      }
      else {
      $.each(data, function (i, item) {
      var header = "&lt;h3&gt;Manufacturer's Representative&lt;/h3&gt;";
      var businessName = $("&lt;h4 id=businessName" + i + "&gt;&lt;/h4&gt;").text(item.BusinessName);
      var contactName = $("&lt;h4 id=contactName" + i + "&gt;&lt;/h4&gt;").text(item.Contact);
      var address = $("&lt;div id=address" + i + "&gt;&lt;/div&gt;").text(item.Address);
      var address2 = $("&lt;div id=address2" + i + "&gt;&lt;/div&gt;").text(item.City + ", " + item.State + " " + item.Zipcode);
      var phone1 = $("&lt;div id=phone1" + i + "&gt;&lt;/div&gt;").text("PH: " + item.Phone1);
      var phone2 = $("&lt;div id=phone2" + i + "&gt;&lt;/div&gt;").text("PH2: " + item.Phone2);
      var fax = $("&lt;div id=fax" + i + "&gt;&lt;/div&gt;").text("FAX: " + item.Fax);
      var email = '&lt;div id=email' + i + '&gt;&lt;a href="' + item.Email + '"&gt;' + item.Email + '&lt;/a&gt;&lt;/div&gt;';
      var website = '&lt;div id=website' + i + '&gt;&lt;a href="' + item.Website + '"&gt;' + item.Website + '&lt;/a&gt;&lt;/div&gt;';
      if (item.RegionalRepId == item.Id) {
      header = "&lt;h3&gt;Regional Manager&lt;/h3&gt;";
      }
      $("#results").append(header, businessName, contactName, address, address2, phone1, phone2, fax, email, website);
      if (businessName[0].textContent == "null") {
      $("#businessName" + i).remove();
      }
      if (contactName[0].textContent == "null") {
      $("#contactName" + i).remove();
      }
      if (address[0].textContent == "null") {
      $("#address" + i).remove();
      $("#address" + i).remove();
      }
      if (phone1[0].textContent == "PH:null") {
      $("#phone1" + i).remove();
      }
      if (phone2[0].textContent == "PH2:null") {
      $("#phone2" + i).remove();
      }
      if (fax[0].textContent == "FAX:null") {
      $("#fax" + i).remove();
      }
      if (email.includes("null")) {
      $("#email" + i).remove();
      }
      if (website.includes("null")) {
      $("#website" + i).remove();
      }
      });
      }
      });
      }  
  </code></pre>
  
  <p>expected result is to just pull and display data by different click events and searches to a map. Clicking on a state works, typing in a zipcode and hitting enter works, but typing in a zipcode and clicking search does not work. </p>
  
  <p>If you guys have any suggestions it would be greatly appreciated. Young in my career, mostly have worked in .NET, C#, and Xamarin. Unfortunatly JS and JQuery are a little new to me. Thanks!</p>