我有一些组合框,需要选定组合框的值。
我这样做:
但不工作。
var check_combo_box_values = $('#combos .combo').filter(function() { 
                return this.selectedIndex === 0;
                }).map(function () 
                {
                    return $('option:selected', this).map(function() {
                    return parseInt(this.value);
                    }).get();
                }).get();
另一方面,这是有效的:
var combo_box_values = $('#combos .combo').filter(function() {
                return this.selectedIndex === 0;
                }).map(function () 
                {
                    return $('option:not(:selected)', this).map(function() {
                    return parseInt(this.value);
                    }).get();
                }).get();
我有第二个代码,并试图使其适应我的需要,第一次尝试出现了。似乎不正确(:错误在哪里?
干杯