JQuery live ‘change’ doesn’t work in IE
Posted in JQuery on May 4th, 2010 by taswar
So was having issues as in why does my checkbox doesn’t work in IE when I do
1 2 3 | $('.checkbox').live('change', function() { alert('Checkbox clicked'); }); |
And found out that jquery does not bind live “change” events, I was told that it works in 1.4.2 but for some reason I still was not able to get it working.
The solution that I found was to use the livequery or bind method thus the code would become
1 2 3 | $('.checkbox').bind('change', function() { alert('Checkbox clicked'); }); |
or if you are using Ajax then
1 2 3 | $('.checkbox').livequery('change', function() { alert('Checkbox clicked'); }); |
That should do the trick, remember to add jquery.livequery.js if you are using livequery in your file.
3 Responses
Leave a Comment

June 7th, 2010 at 3:19 pm
This was helpful.
July 13th, 2011 at 2:57 pm
I realize this post is over a year old, but I hope this is helpful to anyone else who stumbles upon it like I did.
You need to make sure you are in fact setting class=”checkbox” for your checkboxes if you are going to access them with $(“.checkbox”).live(…);
. If not, you can access them using
$(“input[type="checkbox"]).live(…);
Also, using live() is costly compared to other dynamic event handling methods, like bind() or delegate().
July 13th, 2011 at 3:02 pm
Yes I agree, but bind does not work in data that is dynamic I would recommend delegate better.