How to disable multiple select options

前端 未结 2 813
时光取名叫无心
时光取名叫无心 2021-01-24 18:56

How to disable multiple options in one select. For example i have 2 selects with 5 and 3 options. So if i select 3rd option in second select, i want to disable 3rd,4th and 5th o

2条回答
  •  日久生厌
    2021-01-24 19:11

    Also you can disable them:

    var ary=[3,4,5];
    $('[name=smjer] option').filter(function(){
        return ($.inArray(parseInt(this.value),ary) >-1);
    }).prop('disabled', true);
    

提交回复
热议问题