Hey guys, what function could I use to say, if this radio button is checked show this \'div\'. Thanks in advance.
HTML
jQuery
$('#form-id').change(function() {
if ($('#watch-me').attr('checked')) {
$('#show-me').show();
} else {
$('#show-me').hide();
}
});
You can see it in action here: http://jsfiddle.net/wmKGd/
UPDATE 25.01.2013
After Upgrading from jQuery Library 1.8.x to 1.9.x
Please use instead of
jQuery Library 1.8.x
jQuery('#some-id').attr('checked')
jQuery Library 1.9.x
jQuery('#some-id').prop('checked')
You can see it with updated script in action here: http://jsfiddle.net/9XXRY/