Select numbers (you can select each number any number of times):
<select name="number_selection" method="post" id="number_selection" >
<option value="0">0</option>
<option value="1">1 </option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<input type="button" value="Select" id="select_button"/>
<div id="feedback"> </div>
这是我选择和取消选择的jquery:
$('#select_button_gs').click(function(){
var gs= $('#slct_fcb_gs').val();
$('#fcb_pt_gs').append('<span>' + gs + '</span>' + ' ' + '<input type="button" value="Remove" class="gs_remove" />' + '<br>');
});
$('#fcb_pt_gs').on('click','.gs_remove',function(){
$(this).prev('span').remove();
$(this).next('br').remove();
$(this).remove();
});
现在,如果我想在选择后为每个选项分配不同的类/ ID,我该怎么办?