Why Isn't Getelementsbyclassname Working?
I can't understand why getElementsByClassName isn't working here.
Solution 1:
- The function name is
getElementsByClassName
, notgetElementByClassName
getElementsByClassName
returns an array-like object of elements, not the one of elements.
Code should look like this:
n = newDate();
y = n.getFullYear();
document.getElementsByClassName("date")[0].innerHTML = y;
<spanclass="date"></span> CompanyName
Post a Comment for "Why Isn't Getelementsbyclassname Working?"