IE not detecting jquery change method for checkbox
Posted
by user271619
on Stack Overflow
See other posts from Stack Overflow
or by user271619
Published on 2010-03-31T03:32:01Z
Indexed on
2010/03/31
3:33 UTC
Read the original article
Hit count: 446
The code below works in FF, Safari, Chrome. But IE is giving me issues.
When a checkbox is checked, I cannot get IE to detect it.
$("#checkbox_ID").change(function(){
if($('#'+$(this).attr("id")).is(':checked')){ var value = "1"; }else{ var value = "0"; } alert(value);
return false; });
Simply, I'm not getting that alert popup, as expected.
I've even tried it this way:
$("#checkbox_ID").change(function(){
if( $('#'+$(this).attr("id")'+:checked').attr('checked',false)){ var value = "1"; }else{ var value = "0"; } alert(value);
return false; });
Here's the simple checkbox input:
Anyone know if IE requires a different jquery method? or is my code just off?
© Stack Overflow or respective owner