How to hide html form select option?

后端 未结 4 1060
萌比男神i
萌比男神i 2021-01-24 01:43

I have a very simple form which I would like to hide select options when another select field refines it.

Currently I have tried dispay: none as an inline s

4条回答
  •  伪装坚强ぢ
    2021-01-24 02:20

    You cannot hide/remove individual options, only apply the attribute disabled on them. They will appear grey'ed out but won't be selectable.

    You could progmatically keep a variable object that has all the data for the default configuration of the select. Then when you need to remove options you can but still have a way to know what needs to go into the select when all your conditions align.

提交回复
热议问题