title: How do I populate value to second input field based on a onchange event on a 'select' input?
body: <p>I am looking to duplicate the value of a select input into a second input field using Javascript. I tried to do this using an onchange event call. What should the js code be in order to populate the input field id ='sort' upon change in the select function?</p>
  
  <p>Here is my code</p>
  
  <pre><code>&lt;input id = "sort"&gt;
  &lt;select name="sort_select" onchange="document.getElementById('sort').value = ('#sort_select').val();"&gt;
    &lt;option value="Ascending"&gt; Ascending&lt;/option&gt;
    &lt;option value="Descending"&gt; Descending&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>This does not work. I see the error lies in value assignment (('#sort_select').val();)What is the correct way to do this?</p>