Board Thread:Watercooler/@comment-25523075-20150804103143/@comment-24473195-20150804135027

Shining-Armor wrote: returns an array of elements that have the specified class. Right now you are trying to access a property of an object to an array. You simply need to define which element in the array you want to alter.

For example, if you want to change the color of the first returned element you would do as follows:

If you want to alter the properties of all of them then you will need to iterate over the array and alter each element's color manually like so:

@Shining : There's a typo, it is getElementsByClassName.

Also, PhillippL is clearly a beginner and might not even know what an array is.

@PhillippL: Programming isn't something you wake up one day and decide to do, your main problem is that you lack the basics, you don't understand functions, arrays, variables, case sensitivity, APIs, and many other central concepts of programming. That's why you'll waste considerable time asking a million questions.

A considerable number of people even learning at university fail at programming, and give up on the course.

If you want to take shortcuts, then you'll struggle a lot, start with the basics. Use search engines, download a simple book on programming. Your profile shows that you're a german speaker so you may want to use german sites which will explain things in way you understand.

The bottom line is that you need to READ a LOT!