CSS - Hide elements (class) based on value of select box

前端 未结 3 1566
轮回少年
轮回少年 2021-01-22 11:36

I have a item, however because of the pseudo class :checked states of checkboxes and radio buttons, you can accomplish what you wanted using those instead:

HTML

 

 

    

CSS

input[id=other]:checked ~ .applicableSupportCase {
  visibility:hidden;
}

I used visibility, but you can change the attribute to whatever you want.

If you want an ease in and out, then create the same statement using the :not(:checked) pseudo class:

input[id=other]:not(:checked) ~ .applicableSupportCase {
  //whatever ease(out) you want here
}

JSFiddle: http://jsfiddle.net/ja2ud1Lf/

提交回复
热议问题