I’m relatively inexperienced with Javascript and am trying to write a simple script to expand/collapse a ul by changing its class. My problem is using the getElementsByClass() / getElementsByClassName() functions. Firebug says it is not defined. I have the jQuery library loading but still no success.
Here is the code so far:
[CODE]
var collapsers = getElementsByClassName(“collapser”);
for (var i = 0; i < collapsers.length; i++) {
var collapser = collapsers[i];
alert(collapser);
}
function togglecollapsers() {
}
Obviously no functionality yet, just intended to show alerts to show the script has selected the objects. But nothing.