Reputation: 33
I am trying to make function that searches my page for classes ardiv
and then search these classes for class with name hiddenid
but i am still getting error
document.getElementsbyClassName is not a function.
I have read many articles with same error but no solution helped me.
Here is my code:
function hledat() {
var divs = document.getElementsbyClassName("ardiv");
for (var i = 0; i < divs.length; i++) {
var para = divs[i].getElementsbyClassName( "hiddenid" ).value;
alert( para );
}
}
hledat();
Upvotes: 2
Views: 5291
Reputation: 67778
Should be document.getElementsByClassName
(the "B" is the difference)
Upvotes: 5