Skip to content
Advertisement

display different comand and result from getElementsByClassName() Method

i just wanna ask how to change or display the different color with “getElementsByClassName() Method” in javascript,so here i want to change the bacground color blue from class “ex”,and color red form class “example”,but it doesnt work.

JavaScript

Advertisement

Answer

your code works fine but you had two variables with the name collection rename one of them

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement