I have this line of JS which I have determined is wrong.
classes[i] = document.getElementsByAttribute ("class", show_hide_class_selectors[i]);
In context
for (var i = 0; i< show_hide_class_selectors.length; i++) {
classes[i] = document.getElementsByAttribute ("class", show_hide_class_selectors[i]);
alert ("ok");
}
Can someone see where this is wrong?
You invented a non-standard
getElementsByAttributemethod on thedocumentobject, and the code is failing because it doesn’t exist.You should probably looking at using a selector engine; every major JS library includes one, and there are a number of tiny implementations you can use.