-1

同じクラスのコンボベックスが 5 つあります。

どのコンボボックスが値5を選択したかを見つけたい

私の試み:

$(document).ready(function($){
    previous = 0;
    $('.check').focus(function () {
        // Store the current value on focus and on change
        previous = this.value;
    }).change(function() {
        // Do something with the previous value after the change
        //change previous container with value
        newVal = this.value; 
        //alert(previous);
        console.log('Old Val: ' + previous + '- new val:' + newVal);
        $lst = $('.ranking option[value=' + newVal + ']:selected');
        console.log('one ' + $lst.length);

        // Make sure the previous value is updated
        previous = this.value;
    });

});
4

2 に答える 2