0

http://jsfiddle.net/anvhw/1/

I'm having some trouble trying to change a property on the <a> tag when the first radio button is checked. It works fine when I want to change a <label> property when one is checked but not with the <a>

Can anyone help me out?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
james
  • 39
  • 4

1 Answers1

1

The + selector means there must not be any other elements coming between the two elements. The reason + label works is because your label comes immediately after your radio button. However, that label is standing between your radio button and the div, so #radio-one:checked + div won't work.

You need to use

#radio-one:checked + label + div a

Updated fiddle

Also see this answer for an illustration on how the + selector works.

Community
  • 1
  • 1
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356