title: modifying javascript variable within function
body: <p>I've read up on declaring variables globally and then being able to modify them in functions, but things aren't working out for me.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var selectee = "JK";
  // get state selected
  $('select.form-control.bfh-states').change(function () {
      selectee = $('select option:selected').val();
      // works correctly, but i need to access it outside the function
      console.log(selectee); 
  });
  
  // output JK, should change based on a select box on the form
  console.log(selectee); 
  </code></pre>