Dynamically select Drop Down in Jquery

前端 未结 4 890
遇见更好的自我
遇见更好的自我 2021-01-29 09:16

I have 4 Drop Downs.

Each drop by default has a --select-- option. Each box has a unique id. As you can see, the second drop down is disabled if the above drop

4条回答
  •  深忆病人
    2021-01-29 09:38

    Assuming the option that has '--select--' as text has no value, just use val on the handler to check if the selected option is other than the empty

    if(this.val() !== '') {
    // enable following select
    }
    

提交回复
热议问题