I want to know if there is a way to getElementByClassName("classname").innerHTML function or something to the equivalent of getElementById("ClassName").innerHTML.
I want to know if there is a way to getElementByClassName(classname).innerHTML function or something
Share
You are missing an
sin your function name.getElementsByTagNamereturns a collection of elements, of elements, which you need to iterate over:IE8 and below don’t support
getElementsByClassName, so you’ll have to find a polyfill or usequerySelectorAll(IE8).