Solution, but also question

What is your hint or solution suggestion?
The solution is document.getElementsByClassName(‘message’)[0].textContent=“Here is the message”;

However, why do we need to add [0] to the end of the selector? Doesn’t that mean index of 0?

Challenge: Change Text with click Events

Link to the challenge:

Hey @nick0989,

Yes, it does. The function that you are using to get elements is the getElementsByClassName. If you noticed its get ELEMENTS with an s that means it expects more than one elements to have the same class names. That just means that the method will always return an array. So to access the element you have to access it like an array.

Hope this helps a little bit