I have no idea why this wont work but I have tried the following:
$('#elemid').prop('checked', true);
$('#elemid').attr('checked', true);
$('#elemid').attr('checked', 'checked');
IE9 just absolutely refuses to actually check the box when the code is run. I know the code is being run due to console.log.
However no checked element.
This code works perfectly in FF and Chrome. Am I missing something here?
$(function() { ... });
construction - Interrobang 2012-04-04 06:34
.prop()
is included in jquery version 1.6, Make sure you have the right version., and this will be support by IE9 , hope you might have done a small mistake around. the browser prior to IE9 will have memory leaks in using prop()
hope you didn't forgot about it - iDroid 2012-04-04 06:41
Ok, my problem was incredibly stupid.....
I had each checkbox inside a floated labels. why I used labels for this is beyond me, but the label was also registereing a click which was unchecking the box immediately after my code "checked" the box.
I was able to fix the issue by moving the input's out side of the label fields (they are display: none anyway)
The whole point of this is a fancy checkbox system with logos instead of check boxes. The background of the label changes when its click to show active selection etc etc.
Thanks for the help guys.