'jquery select value based radio conditional disable

when a user select as type1 he can only choose radio button of value=card, cod option should be disable.

<select id="ctype" name="type">
                <option value="1">type1</option>
                <option value="2">type2</option>
                <option value="3">type3</option>
                <option value="4">Type4</option>
            </select>


            <input type="radio" class="payment" name="paymentid" value="card"/>card
            <input type="radio" class="payment" name="paymentid" value="cod"/>cod

     $("#ctype").on('change', function(){
         this.value !== "1"
         $('.payment').prop({disabled: this.value === "1", checked: false});
     })
     .change();
});

how do i allow only card radio button and disable the cod radio option when user select type1.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source