how to get the text of select options?
<p>i have this code , and im currently getting the 'mytablevalues' but i wonder if i can get 'myvalues' , i mean only the text of the select. </p>

<pre><code> &lt;form id="aform" method="post"&gt;
 &lt;select id="menucompare" name ="menucompare" size="1"&gt;
&lt;option value="nothing" &lt;?php if ($menucompare == "nothing") { echo " selected='selected'"; } ?&gt;&gt;Select one&lt;/option&gt;

&lt;option value="mytablevalue1" &lt;?php   if ($menucompare == "mytablevalue1") { echo " selected='selected'"; } ?&gt; &gt;myvalue1&lt;/option&gt;
&lt;option value="mytablevalue2" &lt;?php   if ($menucompare == "mytablevalue2") { echo " selected='selected'"; } ?&gt; &gt;myvalue2&lt;/option&gt;
&lt;option value="mytablevalue3" &lt;?php   if ($menucompare == "mytablevalue3") { echo " selected='selected'"; } ?&gt; &gt;myvalue3&lt;/option&gt;
&lt;option value="mytablevalue4" &lt;?php if ($menucompare == "mytablevalue4") { echo " selected='selected'"; } ?&gt; &gt;myvalue4&lt;/option&gt;


&lt;/select&gt;
&lt;input type="hidden" name="hidevalue" value="&lt;?php echo $menucompare ;  ?&gt;" /&gt;
&lt;noscript&gt;&lt;input type="submit" value="Submit"&gt;&lt;/noscript&gt;
&lt;/form&gt;

&lt;script type="text/javascript"&gt;

   $(document).ready(function(){
    $("select").change(function() { 
         displayVals(); 
   });
   displayVals();
 });

function displayVals() {
var singleValues = $("#menucompare").val();
$("#hiddenselect").val(singleValues);
$("p").html("Procent of :    " + singleValues);
}
</code></pre>

<p>and also im having trouble with default value (nothing).
any suggest !</p>

<p></p>

<p>EDIT .
 i get it to work like that</p>

<pre><code>   &lt;script type="text/javascript"&gt;

  $(document).ready(function(){
   $("select").change(function() { 
         displayVals(); 
   });
   displayVals();
   });

  function displayVals() {
var singleValues = $("select option:selected").text();
$("#hiddenselect").val(singleValues);
$("p").html("Procent of : &amp;nbsp &amp;nbsp" + singleValues);
 }

&lt;/script&gt;
</code></pre>
