kosnkov
kosnkov

Reputation: 5911

IE, jquery checkbox doesn't change

I have this html syntax:

<input type="checkbox" id="openInNewWindowCheckBox" value ="some_value"  />

and a jquery script:

$("#openInNewWindowCheckBox").change(function(){

            if($(this).is(':checked'))
            { 

            }
            else
            { 

            }   

            return false; 
        });

and in IE i just can't change or unchange the checkbox, html for it looks like this:

<input id="openInNewWindowCheckBox" type="checkbox" _just_changed="true" jQuery18203967820199374023="133" value="some_value"/>

Upvotes: 0

Views: 176

Answers (2)

Akhil Sekharan
Akhil Sekharan

Reputation: 12683

Returning false prevents the default action. You try returning true for that.

         $("#openInNewWindowCheckBox").change(function(){

        if($(this).is(':checked'))
        { 
            console.log('a');
        }
        else
        { 
            console.log('b');
        }   

        return true; 
    });

Upvotes: 2

Tomi Lammi
Tomi Lammi

Reputation: 2126

As far as I know, checkbox change triggers only after you blur from the checkbox in IE. Bind it to click instead.

Upvotes: 0

Related Questions