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!