I have radio buttons as follows:
<input type='radio' name='ans' value='0'> Dog
<input type='radio' name='ans' value='1'> Horse
<input type='radio' name='ans' value='2'> Cat
<input type='radio' name='ans' value='3'> Camel
<input type="button" value="Change Color" onclick="changeColor()" />
When i click the button, i want a certain radio button text to turn Green in color.
For eg. if the correct answer(value='2') is Cat, then Cat text should be turned green.
Here's an incomplete function - i guess i am missing the part that selects the radio button based on value:
var changeColor = function()
{
$("input[name=ans]").css('color', 'green');
}