I know there is many similar questions but I don't know why it doesn't work to me
I have collection
cars = document.gelementsByClassName('car');
for (i in cars){
let attr = cars[i].getAttribute('segment');
}
And its going down with messege "getAttribute is not a function" and loop is not go to end. I tried use try-catch but it doesn't word loop still not go to end Even it is really error i would like to ignore this error and go to end.