title: JavaScript selectAll\deselectAll checkboxes function doesn't work on IE8
body: <p><p>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.<br/>
  All the checkboxes are generated dynamically with the subscribers names.<br/>
  You can check any member you want and you also have a special checkbox that enables you to select or deselect all the members.<br/>
  This specific checkbox works properly on Chrome and Firefox.<br/>
  However, when you check it on Internet Explorer 8, none of the members are selected or deselected, whether they names are check or not.<br/>
  Here is the code sample of the form generation and of the onClick functions triggered when you check the checkbox : <br/></p>
  
  <pre><code>   updateMembersList : function TS_updateMembersList(containerId)
     {
         var div = Dom.get(containerId);
         div.innerHTML = "&lt;div class=\"memberDiv\"&gt;" +
             "&lt;input type=\"checkbox\" id=\"selectDeselectAllCb\" checked=\"true\" onchange=\"YAHOO.Bubbling.fire('selectDeselectAllChanged')\" class=\"memberCb\"/&gt;" +
             "&lt;label for=\"selectDeselectAllCb\" class=\"memberLabel\"&gt;" + 
             this.msg('label.selectDeselectAll') + "&lt;/label&gt;" +
             "&lt;/div&gt;";
  
         for (var i=0; i&lt;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 &amp;&amp; member.avatar != "")
             {
  
                 avatar = Alfresco.constants.PROXY_URI + member.authority.avatar + "?c=force";
             }
             div.innerHTML += "&lt;div class=\"memberDiv\"&gt;" +
  
                  "&lt;input type=\"checkbox\" id=\"cb_" + member.authority.userName + "\" checked=\"true\" onchange=\"YAHOO.Bubbling.fire('selectDeselectMemberChanged')\" class=\"memberCb\"/&gt;" +
                  "&lt;label for=\"cb_" + member.authority.userName + "\" class=\"memberLabel\"&gt;" + 
                          member.authority.firstName + " " + member.authority.lastName + "&lt;/label&gt;" +
                  "&lt;/div&gt;";
         }
     },
  
  
     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&lt;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&lt;j; i++)
         {
             var cb = cbs[i];
             if (cb.checked === firstChecked){
                 continue;
             }
             else{
                 selectDeselectAllCb.checked = false;
                 return;
             }
         }
         selectDeselectAllCb.checked = firstChecked;
     },
  </code></pre>
  
  <p>At the beginning, I thought that the query wasn't supported by IE8, but it's not the case.<br/>
  Such a syntax is supported by IE7 and more recent versions.</p>