multiple select元素支持选中多个option,如何获取选中的多个值?
<pre name="code" class="html"><select multiple="multiple" name="states">
<option value="1">Alabama</option>
<option value="2">Alaska</option>
<option value="3">California</option>
<option value="4">Texas</option>
</select>
{
"states" : "3"
}
应写为
<select multiple="multiple" name="states[]">
<option value="1">Alabama</option>
<option value="2">Alaska</option>
<option value="3">California</option>
<option value="4">Texas</option>
</select>
{
"states" : [
"2",
"3"
]
}