indexOf is a bad way of matching classnames, because it would return true for a partial match (e.g. Making statements based on opinion; back them up with references or personal experience. it works PERFECTLY as is. Matching multiple classes. For instance if I needed to disable groupA and groupB on one chehckbox but groupA and groupC on another? I've updated my code accordingly. That I get, I guess I was misapplying what I had read. For example, suppose we have the following elements in our DOM. Should be set like berninis = berninis.concat (document.getElementsByClassName('matisse')); Wow, I think I "get this". Let's look at some examples to know and understand the practical implementation of the method. Example How do I make that one still enabled when 'Single graphic use' is checked, but not enabled if 'Clip-in Top Rail' is checked? When it is called as a method of document, this method returns all elements in the DOM which bear the classes specified. How to select all/unselect all the check boxes which are not disabled? We then loop through that array and essentially perform the rest of the code for both of them. line 108 character 23: function hasClass(el, class) { For the case when you need to control checkboxes from two different groups, I would add another class to each element - to