朋友们好这是我的代码:
<select id='first'>
<option value='1'> First </option>
<option value='2'> Second </option>
<option value='3'> Three </option>
</select>
这是我的select2代码:
$("#first").select2();
Below is code for getting selected value.
$("#first").select2('val'); // It returns first,second,three.
This is return a text like first,second,three
and I want to get 1,2,3
.
Means I need the value of select box, not text.