Custom checkbox jQuery

I have i problem with a jQuery function.
My objective is to make custom checkboxes and it works fine except in IE.

input.is(‘:checked’) keeps returning false when it should return true.
So every time i click on the checkbox it keeps returning false in IE
It works fine in Firefox and Crome.

What am I doing wrong?
Is there an issue with is(‘:checked’) in explorer?



$(function() {
	$(':checkbox').checkbox();	
});

(function($) {
	jQuery.fn.checkbox = function(){
		$(this).each(function(){
			var input = $(this);
			var label = $('label[for='+input.attr('id')+']');
			
			label.click(function(){
				if (input.is(':checked')) {
					label.removeClass('checked');
				}
				
				else {
					label.addClass('checked');
				}
				alert(input.attr('id').is(':checked'));
			})
	});
};
})(jQuery);

Looks like you had a small error in your alert:


alert(input[COLOR=#ff0000].attr('id')[/COLOR].is(':checked'));

If you take of the .attr(‘id’) in there it should work.

(Working example http://jsfiddle.net/GeekyJohn/D35PA/)

Doooooooooh as Homer Simpson would have said :slight_smile:
Thank you for your help buddy

Cheers