Target the label of a checked input

前端 未结 2 1284
悲&欢浪女
悲&欢浪女 2021-01-22 14:18

If I have a radio input that is wrapped within a label, how can I target the label when the input is checked?

Payment Plan:

&l
2条回答
  •  死守一世寂寞
    2021-01-22 14:29

    Your css will work if you modify your html to this:

    Payment Plan:

    Using the for attribute with an id on the input will let you click on the label to affect the button, as it does when wrapped in the element.

    http://jsfiddle.net/PMmrk/

提交回复
热议问题