+ 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

12th Jul 2018, 5:16 AM
Daniel Cooper
Daniel Cooper - avatar
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 */
12th Jul 2018, 5:35 AM
CalviŐ˛
CalviŐ˛ - avatar