Q:

JavaScript selectAll\deselectAll checkboxes function doesn't work on IE8

I have a Webscript (.js file) developed for an Alfresco application. It handles a button that displays a form aimed at selecting members which have subscribed to an Alfresco space, in order to send them a mail.
All the checkboxes are generated dynamically with the subscribers names.
You can check any member you want and you also have a special checkbox that enables you to select or deselect all the members.
This specific checkbox works properly on Chrome and Firefox.
However, when you check it on Internet Explorer 8, none of the members are selected or deselected, whether they names are check or not.
Here is the code sample of the form generation and of the onClick functions triggered when you check the checkbox : 
   updateMembersList : function TS_updateMembersList(containerId)
   {
       var div = Dom.get(containerId);
       div.innerHTML = "<div class=\"memberDiv\">" +
           "<input type=\"checkbox\" id=\"selectDeselectAllCb\" checked=\"true\" onchange=\"YAHOO.Bubbling.fire('selectDeselectAllChanged')\" class=\"memberCb\"/>" +
           "<label for=\"selectDeselectAllCb\" class=\"memberLabel\">" + 
           this.msg('label.selectDeselectAll') + "</label>" +
           "</div>";

       for (var i=0; i<this.members.length; i++)
       {
           var member = this.members[i];
           var avatar = Alfresco.constants.URL_CONTEXT + "/components/images/no-user-photo-64.png";

           if (member.authority.avatar && member.avatar != "")
           {

               avatar = Alfresco.constants.PROXY_URI + member.authority.avatar + "?c=force";
           }
           div.innerHTML += "<div class=\"memberDiv\">" +

                "<input type=\"checkbox\" id=\"cb_" + member.authority.userName + "\" checked=\"true\" onchange=\"YAHOO.Bubbling.fire('selectDeselectMemberChanged')\" class=\"memberCb\"/>" +
                "<label for=\"cb_" + member.authority.userName + "\" class=\"memberLabel\">" + 
                        member.authority.firstName + " " + member.authority.lastName + "</label>" +
                "</div>";
       }
   },

   selectDeselectAllChanged: function selectDeselectAllChanged(){
       var selectDeselectAllCb = Dom.get('selectDeselectAllCb');
       var checked = selectDeselectAllCb.checked;
       console.log("Select All");
       var cbs = YAHOO.util.Selector.query("input[id^='cb_']");

       for (var i=0, j=cbs.length; i<j; i++)
       {
           var cb = cbs[i];
           cb.checked = checked;
       }
   },

   selectDeselectMemberChanged: function selectDeselectMemberChanged(){
       var selectDeselectAllCb = Dom.get('selectDeselectAllCb');
       var cbs = YAHOO.util.Selector.query("input[id^='cb_']");

       var firstChecked;
       if (cbs[0] != null){
           firstChecked = cbs[0].checked;
       }

       for (var i=0, j=cbs.length; i<j; i++)
       {
           var cb = cbs[i];
           if (cb.checked === firstChecked){
               continue;
           }
           else{
               selectDeselectAllCb.checked = false;
               return;
           }
       }
       selectDeselectAllCb.checked = firstChecked;
   },

At the beginning, I thought that the query wasn't supported by IE8, but it's not the case.
Such a syntax is supported by IE7 and more recent versions.

A:

I've solved the problem. I've replaced the onchange event handler by an onclick event handler. Indeed, onchange has a random behaviour on Internet Explorer, whereas onclick works fine in most of the case.
Thanks for the help.

