title: Call JS Function with Form Submit Value
body: <p>I have a autocomplete form inputs, I want to call a javascript function with the autocomplete selected value.</p>
  
  <p>I have the form and the JS function, on submit if I give a specific value it's calling the js function. But I didn't get how to pass the value of the form submit to the js function. Here is the code I tried. if you have any idea how to pass the values, please let me know. your help is much appreciated. thanks. </p>
  
  <pre><code>&lt;form autocomplete="off" action="/action_page.php"&gt;
    &lt;div class="autocomplete" style="width:1120px;"&gt;
      &lt;input id="myInput" type="text" name="myCountry" placeholder="country"&gt;
    &lt;/div&gt;
    &lt;input onclick="filterSelection('all')" type="submit"&gt; &lt;!-- filterSelection() is the JS function, and I am passing value as 'all'. its working. But I want to pass the submit value from the form.
  &lt;/form&gt;
  </code></pre>