<select name="plan" class="form-control selectpicker" >
<option value=" " >Please select your plan</option>
<option value="10" value="free"> Free</option>
<option>Standard</option>
<option >Premimium</option>
<option >Professional</option>
</select>
我想将value =“10”的value =“free”插入同一个表的另一列
答案 0 :(得分:-1)
你可以这样做:
<select name="plan" id='something' class="form-control selectpicker" >
<option value=" " >Please select your plan</option>
<option value="10" data-value="free"> Free</option>
<option>Standard</option>
<option >Premimium</option>
<option >Professional</option>
</select>
然后你可以使用jQuery访问它:
$('#something').attr('data-value');