removing all options of select box except 1st option

前端 未结 8 2142
情书的邮戳
情书的邮戳 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:23

    You can use not(:first)

    $('#lForm select[id!="makeClick"] select[id!="stateClick"] select[id!="cityClick"]  option:not(:first)').remove().end();
    

提交回复
热议问题