fazlurr
4/29/2014 - 8:20 PM

Give the label of a radio button a checked class when the input changes.

Give the label of a radio button a checked class when the input changes.

jQuery(function($) {
	$(':radio').change(function () {

		// First, clear out all radio buttons
		$(':radio[name=' + this.name + ']').parent().removeClass('checked');

		// Add the checked class to the parent. (probably a label)
		$(this).parent().addClass('checked');

	});
});