+ 1
Why isn't this working?
I wanted to see what would happen if I used 2 if the same ID. Is it failing because there's 2 or is there something I'm unintentionally doing wrong? https://code.sololearn.com/WoOBKjaivtfE/?ref=app
1 Answer
+ 3
id must be unique.
And you have error on class element access.
The correct way to access class element is
OutTwo[0].style.color = "blue"; /* first element */
OutTwo[1].style.color = "blue" /* second element */