Please take a look at http://jsfiddle.net/JHMqG/
I'm trying to figure out how to change the background of the radio button when clicked.
So far, I've been successful with the cat option, but I'm stuck at the dog option. I need the dog option to work because I want the background change to include the circle button.
Please advise. Thank you.
The problem was the
<input>
was just preceding the<label>
in the cat option, but in the dog option the<input>
was inside the<label
.I corrected it by moving the
<input>
of the dog option to be preceding the label, you can see it working here:http://jsfiddle.net/SxPvz/
See this:
DEMO
I changed a bit the HTML:
and added a few bits to the CSS, so it now looks like this:
Here you go: http://jsfiddle.net/JHMqG/1/
On the dog, the
label
element only contained the text. On the cat, thelabel
element contained the text and the radio button. Also, I cleaned up your HTML a bit.