Undefined SELECT value in jQuery
<p>In my page I have the following SELECT:</p>

<pre><code>&lt;select class="span2" id="emLocality"&gt;
    &lt;option value="_none_"&gt;&amp;nbsp;&lt;/option&gt;
    &lt;option value="000696" selected&gt;USA&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>Then in JavaScript I run this snippet:</p>

<pre><code>var loc = $("emLocality").val();
console.log (loc);
console.log ($("#emLocality").val ());
</code></pre>

<p>and get the following output:</p>

<blockquote>
  <p>undefined</p>
  
  <p>000696</p>
</blockquote>

<p>Does anybody have an idea why?</p>
