I'm tring to change some element when the condition is satisfied.
I need xTick[0]
but it always undefined even there is HTMLColletion
var xTick = document.getElementsByClassName('some class name')
console logs
console.log(xTick)
output:
HTMLCollection []
> 0: text
> 1: text
> 2: text
...
> 8: text
> 9: text
length: 10
> __proto__: HTMLCollection
console.log(xTick.length)
output: 0
console.log(xTick[0])
output: undefined
console.log(xTick)
has correct output but console.log(xTick[0])
and console.log(xTick.length)
dosen't