For some reason this isn't working. Both checked=true and checked==true don't work. //twotexts.js function strongsCheck(){ var KeyWord = "&keyword="; var chkStrongsBox = document.getElementsByClassName("checkbox-inline"); for(i=0;i<chkStrongsBox.length;i++){ if(chkStrongsBox[i].checked=true){ if(i<(chkStrongsBox.length-1)){ KeyWord += +chkStrongsBox[i].value+"|"; }else{ KeyWord += +chkStrongsBox[i].value; } } } alert(KeyWord); } Code (markup): <div id="strongs_list"> <label class="checkbox-inline-all" style="display: block;"><input id="id_all" onclick="if(this.checked){highlightThemAll(); highlightThem()}else{unhighlightThemAll(); unhighlightThem()};" style="border: 1px solid #FFFFFF;" value="all" type="checkbox">all Strongs' in Common</label><br> <label class="checkbox-inline" style="width: 80px; height: 40px; display: block; font-weight: bold; color: red" title=" results: (' of their |fathers|,', ' unto your |fathers|;', ' unto their |fathers|:', ' of their |fathers|,', ' which their |fathers|', ' <em>themselves</em> more than their |fathers|,', ' their |fathers|,', ' therein, as their |fathers|') occuring 8 times as: (''ab', ''ab', ''ab', ''ab', ''ab', ''ab', ''ab', ''ab') - original language:('×ָב', '×ָב', '×ָב', '×ָב', '×ָב', '×ָב', '×ָב', '×ָב') - description: ('a root', 'a root', 'a root', 'a root', 'a root', 'a root', 'a root', 'a root') related to: () also look at: "> <input id="id_0" class="class_strongs" value="H1" onclick="strongsCheck(); if(this.checked){highlightThem1(); highlightThem2();}else{unhighlightThem();};" style="border: 1px solid #FFFFFF;" type="checkbox">[H1]</label><br> <label class="checkbox-inline" style="width: 80px; height: 40px; display: block; font-weight: bold; color: red" title=" results: occuring times as: - original language: - description: related to: () also look at: "> <input id="id_0" class="class_strongs" value="H4519" onclick="strongsCheck(); if(this.checked){highlightThem1(); highlightThem2();}else{unhighlightThem();};" style="border: 1px solid #FFFFFF;" type="checkbox">[H4519]</label><br> <label class="checkbox-inline" style="width: 80px; height: 40px; display: block; font-weight: bold; color: red" title=" results: occuring times as: - original language: - description: related to: () also look at: "> <input id="id_0" class="class_strongs" value="H27" onclick="strongsCheck(); if(this.checked){highlightThem1(); highlightThem2();}else{unhighlightThem();};" style="border: 1px solid #FFFFFF;" type="checkbox">[H27]</label><br> <label class="checkbox-inline" style="width: 80px; height: 40px; display: block; font-weight: bold; color: blue" title=" results: (' |after|', ' |*|', ' |after|', ' |*|', ' |after|', ' |*|') occuring 6 times as: (''achar', ''achar', ''achar', ''achar', ''achar', ''achar') - original language:('×ַחַר', '×ַחַר', '×ַחַר', '×ַחַר', '×ַחַר', '×ַחַר') - description: ('from ×ָחַר (H309)', 'from ×ָחַר (H309)', 'from ×ָחַר (H309)', 'from ×ָחַר (H309)', 'from ×ָחַר (H309)', 'from ×ָחַר (H309)') related to: H309('achar) also look at: "> <input id="id_1" class="class_strongs" value="H310" onclick="strongsCheck(); if(this.checked){highlightThem1(); highlightThem2();}else{unhighlightThem();};" style="border: 1px solid #FFFFFF;" type="checkbox">[H310]</label><br> <label class="checkbox-inline" style="width: 80px; height: 40px; display: block; font-weight: bold; color: blue" title=" results: occuring times as: 'achar - original language: - description: related to: () also look at: "> </div> PHP:
= is assignment, that would be wrong... == compares, but 'checked' only really needs loosy true, so just "if (Element.checked) {" is all you need... BUT... Your array contains the labels, NOT the inputs. DOH! That said, with the inlined style, inlined scripting, outmoded use of onevent, bizzaroland title="" values, and presence of scripting that seems to be just there to do CSS' job... NONE of which really even belongs in your markup, lack of for attributes on your labels, failure to even close your labels -- you've got problems! Problems like more than half that code belonging on the scrapheap. Of course if that was a proper FIELDSET instead of a DIV that would be your selector isolation letting you axe 90%+ of your classes altogether!