title: How to create a "reusable" function in jquery?
body: <p>I have this bit of code that works great:</p>
  
  <pre><code>function displayVals() {
      var phonevals = $("#bphonesel").val();
      $('#bphone').val(phonevals);
  }
  
  $("select").change(displayVals);
  displayVals();
  </code></pre>
  
  <p>I want to be able to reuse it for all the other select  boxes I have on my site.  So, I thought I'd use parameters to do it.  However, I've so far been unable to get the syntax correct.  Here's what I've got, but it doesn't work.  Any help would be appreciated.</p>
  
  <pre><code>function displayVals(inputfld, boundfld) {
      var nvenval = $(inputfld).val();
      $(boundfld).val(nvenval);
  }
  
  $("select").change(displayVals());
  displayVals('#bphonesel', '#bphone');
  </code></pre>