0

When I change the value of a select option, a corresponding radio button should be clicked.

$(document).ready(function(){
    $('#colorselector').on('change', function() {

        if ( this.value == 'red')
        {
            $('input[name="purchase[product_id]"][value="000000"][type="radio"]').click();
        }
    });
});
4

1 回答 1

1

利用

.prop('checked',true);

代替

.click();

如果你想要的是让收音机“检查”

于 2018-09-26T08:31:46.727 回答