Reputation: 415
I'm trying to check a checkbox, i've tried doing the following :-
$('#someId').attr('checked','checked');
$('#someId').attr('checked', true);
both the above work for ie8,ff but not for ie7!!
I'm using an older version of jquery (1.4.2) so using .prop() is not possible.
Upvotes: 0
Views: 867
Reputation: 9929
You can always go the native Javascript way:
// Get element using jQuery
var myCheckbox = $('#someId').get(0);
// Make it checked old school style.
myCheckbox.checked = true;
Edit:
Of course: document.getElementById("someId") will get you the element totally jQuery independend
Upvotes: 4