title: how to pass variable in jquery .change function
body: <p>I have a form with a simple drop-down menu when the user selects any of the options, i want to be able to pass that selected value to a JavaScript function</p>
  
  <p>Once the user clicks on an option it will alert the value in the jQuery change function but I want to use the value that was passed through in other functions but it does not get the value for some reason</p>
  
  <pre><code>function getTweet(){
    $('#test').change(function() {
      var value = $('#test :selected').val();
    });
  }
  </code></pre>
  
  <p>want to use the value outside of the change function but it does not grab it</p>
  
  <pre><code>&lt;form&gt;  
      &lt;select id="test"&gt;
          &lt;option value="one"&gt;1&lt;/option&gt;
          &lt;option value="two"&gt;2&lt;/option&gt;
          &lt;option value="three"&gt;3&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>