var list = document.getElementsByClassName("sidebar-holder");
console.log(list);// html collection of length 2
console.log(list[0]);// undefined
Here I have run the following code and I have used the comments to console.log()
the results.
While the elements with that class name are being rendered asynchronously, I do not believe that this is the problem as the first console.log()
renders the expected result. The second one does not.