<input type='radio' name='specific_consultant' id='specific_consultant_no' value='no'>No</input>
hii. i have a radio button like this . on click of this radio button , i need to change text color of text like No .. how do i do it..
<input type='radio' name='specific_consultant' id='specific_consultant_no' value='no'>No</input>
hii. i have a radio button like this . on click of this radio button , i need to change text color of text like No .. how do i do it..
You could use the css function:
$(function() {
$('#specific_consultant_no').click(function() {
$(this).css('color', 'red');
});
);
$(document).ready(function() {
var button = $('#specific_consultant_no');
button.click(function() {
button.css('color', 'FOO');
});
});
if you want to reuse the method, you can do eg.
var colorMethod = function() {
$(this).css('color', 'FOO');
};
$(document).ready(function() {
var button = $('#specific_consultant_no');
button.click(colorMethod);
});
you can also use the addClass and removeClass methods, to be more flexible!