jquery - bug with displaying select options
<p>I have multiple select menus where the pattern is :</p>

<pre><code>&lt;select name='device$num' id='device$num' size='8' multiple='multiple' &gt;"
</code></pre>

<p>I want to display the values out when any one of these select changes.</p>

<p>I tried this but sometimes I get undefined values from the alert. what is wrong?</p>

<pre><code>&lt;script&gt;
    \$("select[id^=device]").change(function () {
        \$("#paramselection").html(" ");
        \$("#voltageselection").html(" ");

        // IF THE DATA HAS CHANGED, FIND OUT WHICH DATA SECTIONS ARE STILL VALID

        \$("select[id^=device] :selected").val(function(index, value) {
            alert(value);
        });
    });
&lt;/script&gt;
</code></pre>

<p>Another question, how do i pattern match such that id^=device\d+? Sorry, I am more familar with perl</p>
