document.getElementsByClassName contains text code example
Example: document getelementsbyclassname not getting all elements
//use this instead
document.querySelectorAll(".myclassname");
//use this instead
document.querySelectorAll(".myclassname");