What [0] means when use document.getElementsByClassName | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What [0] means when use document.getElementsByClassName

Example Document.getElementsByClassName("whatever")[0].innerHTML = "my question";

9th Sep 2021, 12:48 PM
EsaKurniawan
1 Answer
+ 1
the very first element of the array
9th Sep 2021, 1:14 PM
Shadoff
Shadoff - avatar