Need to set a variable based on the value of the selected item in a dropdown
<p>I'm trying to set a variable to the value of the selected item in a dropdown but can't get it to work properly. Here is the html:</p>

<pre><code>&lt;select id="locationChoice" name="WorkflowList"&gt;
&lt;option value=" "&gt;-- Please Select --&lt;/option&gt;
&lt;option value="14643"&gt;Item A&lt;/option&gt;
&lt;option value="14644"&gt;Item B&lt;/option&gt;
&lt;option value="14645"&gt;Item C&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>Here's the jquery:</p>

<pre><code>    var rfiSchooldropdown = $('#locationChoice:selected').val(); 
$("#locationChoice").change(function() {
alert(rfiSchooldropdown);
});
</code></pre>

<p>I know I'm close but it's not grabbing the value properly. I'm using "alert" to test, FYI.</p>

<p>Any help is appreciated!</p>
