strange behaviour in select option:selected
<p>I have a few select options boxes on one page, I'm trying to get the value and text of the selected options and insert them into hidden fields, if I select the first one only(first time after page reload)it doesn't work, but if I select the first one and second one after page reload it works,</p>

<p>to make it work I have to first select an option from the second select box and all will work. </p>

<p>here's link to the site.
 <a href="http://www.snappy-pizza.net/sides.php" rel="nofollow">http://www.snappy-pizza.net/sides.php</a></p>

<p>any help would be appreciated.</p>

<pre><code>      &lt;form&gt;
          &lt;input type="hidden" value="MIXED SALAD" /&gt;
          &lt;select  class="select" name="select3" id="select3"&gt;
            &lt;option value="0"&gt;0&lt;/option&gt;
            &lt;option value="1.99"&gt;1&lt;/option&gt;
            &lt;option value="1.99"&gt;2&lt;/option&gt;
            &lt;option value="1.99"&gt;3&lt;/option&gt;
            &lt;option value="1.99"&gt;4&lt;/option&gt;
            &lt;option value="1.99"&gt;5&lt;/option&gt;
            &lt;option value="1.99"&gt;6&lt;/option&gt;
            &lt;option value="1.99"&gt;7&lt;/option&gt;
            &lt;option value="1.99"&gt;8&lt;/option&gt;
          &lt;/select&gt;
       &lt;/form&gt;

        &lt;form&gt;
          &lt;input type="hidden" value="Onion Rings" /&gt;
          &lt;select  class="select" name="select" id="select"&gt;
            &lt;option value="0"&gt;0&lt;/option&gt;
            &lt;option value="1.99"&gt;1&lt;/option&gt;
            &lt;option value="1.99"&gt;2&lt;/option&gt;
            &lt;option value="1.99"&gt;3&lt;/option&gt;
            &lt;option value="1.99"&gt;4&lt;/option&gt;
            &lt;option value="1.99"&gt;5&lt;/option&gt;
            &lt;option value="1.99"&gt;6&lt;/option&gt;
            &lt;option value="1.99"&gt;7&lt;/option&gt;
            &lt;option value="1.99"&gt;8&lt;/option&gt;
          &lt;/select&gt;
       &lt;/form&gt;

   $(function() {

      $('#my-add-button-sides').click(function() {
 var qty = [];
 var price = [];
 var items_names = [];
 var final_price = 0;

 $('.select option:selected').each(function() {
  var $this = $(this);
  if (($this.text()) &gt; 0) {
   qty.push($this.text() );
   price.push($this.val() );
   items_names.push($this.parent().prev('input:hidden').val () );
  }
  $this.attr('selected','');

 });

 var total_price = $.map(qty, function (n,i) {
  return n * price[i];
 });

 $.each(total_price,function() {
  final_price += this;
 });

 var qty_items = $.map(qty, function(n,i) {
  return n +"--"+ items_names[i];
 });


 var randomNumber = Math.floor((Math.random() * 9000) + 200);
 $('input[name=my-item-id]').val(randomNumber);
 $('input[name=my-item-name]').val(qty_items.join('\n') );
 $('input[name=my-item-price]').val(final_price);

  });
  });
</code></pre>
