I am learning JQuery.
I got s Select Tag with some options in a very simple form like this:
(The form was generated by the Server and the values in each Option was retrieved from the database.)
<select name="data[Site1][quotenumber]" id="data[Site1][quotenumber]">
<option name="editquote" value="[29,1]">1</option>
<option name="editquote" value="[24,2]">2</option>
</select>
To get the value from the option selected, I used this code:
var whatValue = $('#data\\[\\Site1\\]\\[quotenumber\\] :selected').val();
alert(whatValue);
Now that I can get the value from the Select Tag, but the returned value was like an array, i.e. [29,1].
What is the best way to get the two values in each option?
I mean to print them out like this way:
The first value is 29, and the second one is 1.
Please help if you could