Uncaught TypeError: Object 0 has no method 'addEventListener'
var A={};
A.addEventsToClassName=function(event,className,func)
{
var a=document.getElementsByClassName(className);
for(var b in a)
{
b.addEventListener(event,func,false);
}
};
Object b is meant to be an element object once the function is called later in the code. How can I prevent this error?