jQuery('#additional-channels-list select').live('change', function(){
var current_id = parseInt(jQuery(this).val());
select_values.push(current_id);
console.log(select_values);
console.log(jQuery.inArray(current_id, select_values));
});
Ctrlキーを使わずに複数のselectを作成したいので、値を配列に格納する必要があります。値をチェックしようとするとinArray
、配列内の現在の値に関する情報ではなく、選択リスト内の選択された要素の位置が返されます。私はどこが間違っていますか?