What am I doing Wrong

A new day, a new problem I’m struggling with.
I’m working through the simply JS book, and I can’t get the “Core.getElementByClass” to work.

var Ruler =
{
init: function()
{
var animal = Core.getElementsByClass(“look”);

if (animal)
{
  alert(animal.nodeName);
}
else
{
  alert("Not found");
}

}
};

Core.start(Ruler);

There is only one html class tag with the value “look” in my code. I do load the core.js, before my script file(both external files).
But when my program runs, JS pops up an “undefined” alert box.

Please help!

Core.getElementsByClass() should return an array of nodes, since many elements can belong to the same class. Try something like this,

var Ruler = {
    init: function() {
        var animals = Core.getElementsByClass("look");

        if (animals.length > 0) {
            for (var i = 0; i < animals.length; ++i) {
                alert(animals[i].nodeName);
            }
        } else {
            alert("Not found");
        }
    }
};

Core.start(Ruler);