2nd May 2019, 7:16 AM
vitalii
vitalii - avatar
2 odpowiedzi
+ 3
This code is correct. getElementById returns only one element or zero. If there is no element with that id it returns no element. If there are one or multiple elements with the id it returns just the first it found. That happens because id should be a unique identifier. If you want to find multiple things than you would need to add a class to the elements and then use getelementsbyclass.
2nd May 2019, 8:04 AM
Dragonxiv
Dragonxiv - avatar
0
Thank you. I understand it.
2nd May 2019, 8:16 AM
vitalii
vitalii - avatar