title: TypeError: Cannot read property 'xxx' of undefined jQuery
body: <p>I am trying to send a post request from site to server which includes user input data. I am getting TypeError: Cannot read property 'vehicle' of undefined as a response here.</p>
  
  <p>HTML and script data:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
          &lt;title&gt;Car Finder&lt;/title&gt;
          &lt;link rel="stylesheet" href="style.css"&gt;
          &lt;center&gt;&lt;h1&gt;Craigslist Vehicle Finder&lt;/h1&gt;&lt;/center&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form class="form"&gt;
              &lt;input type="text" name="vehicle" value="" id="vehicle"&gt;
              &lt;label for="vehicle"&gt;Vehicle&lt;/label&gt;
          &lt;/form&gt;
          &lt;form class="form"&gt;
              &lt;input type="text" name="miles" value="" id="miles"&gt;
              &lt;label for="miles"&gt;Miles&lt;/label&gt;
          &lt;/form&gt;
          &lt;label class="container"&gt;
              &lt;input type="checkbox" id="checkbox"&gt;
              &lt;span class="checkmark"&gt;&lt;/span&gt;
              &lt;label for="checkbox"&gt;Manual&lt;/label&gt;
          &lt;/label&gt;   
          &lt;select id="select" class="City"&gt;
              &lt;option value="null"&gt;Select Location&lt;/option&gt;
          &lt;/select&gt;
          &lt;/div&gt;
          &lt;form class="submit Search"&gt;
              &lt;input type="submit" value="Search Craigslist"&gt;&lt;br/&gt;
          &lt;/form&gt;
          &lt;script&gt;
              var select = document.getElementById("select"),
                      arr = ["atlanta","austin","boston","chicago","dallas","denver","detroit","houston","lasvegas","losangeles","miami","minneapolis","newyork","newhaven","orangecounty","philadelphia","phoenix","portland","raleigh","sacramento","san diego","seattle","sfbay","washingtondc"];
  
                  for(var i = 0; i &lt; arr.length; i++) {
                      var option = document.createElement ("OPTION"),
                          txt = document.createTextNode(arr[i]);
                      option.appendChild(txt);
                      select.insertBefore(option, select.lastChild);
                  }
          &lt;/script&gt;
          &lt;script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"&gt;&lt;/script&gt;
          &lt;script&gt;
              $.post('http://localhost:3000', { vehicle: 'input#vehicle', miles: 'input#miles', location: 'select' }, function (err, result) {
                  if (err) {
                      console.log(err);
                  } else {
                      return data;
                  }
              });
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Server side method to receive the POST data:</p>
  
  <pre><code>app.post('/', (req, res, err) =&gt; {
      if (req.method == 'POST') {
          console.log(req.body.vehicle)
          console.log(req.body.miles)
          console.log(req.body.location)
      }
  })
  </code></pre>
  
  <p>using express server btw</p>