Javascript not acquiring dropdown value
<p>I have a list of 2 values in dropdown list as...</p>

<pre><code>      &lt;select id="prop"&gt;
          &lt;option value="Caa:123"&gt;Ca&lt;/option&gt;
          &lt;option value="Cb:745"&gt;Cb&lt;/option&gt;
      &lt;/select&gt;
</code></pre>

<p>...and in javascript i used...</p>

<pre><code>       var p = document.getElementById('prop');
       var q = p.options[p.selectedIndex].value;
       alert(q);
</code></pre>

<p>...but  I am not getting no alert and an error "Index or size is negative or greater than the allowed amount" code: "1  "
                  Kindly help I trapped in this problem</p>
