removing all options of select box except 1st option

前端 未结 8 2133
情书的邮戳
情书的邮戳 2020-12-29 01:20

I\'m trying to empty select options when:

id \"mClick\" is selected, id\'s \"sClick\", \"cClick\" and \"srClick\" will be emptied.

id \"sClick\" is selected,

相关标签:
8条回答
  • 2020-12-29 02:19

    asssign general class to your Dropdown then

    $('.general option[value!=""]').remove();

    this will remove all options except first one whose value is empty Hope this will helps

    0 讨论(0)
  • 2020-12-29 02:23

    You can use not(:first)

    $('#lForm select[id!="makeClick"] select[id!="stateClick"] select[id!="cityClick"]  option:not(:first)').remove().end();
    
    0 讨论(0)
提交回复
热议问题