I wonder why I cant style multiple elements with the same Id using JS with this code :
var x = document.getElementById('foo').style["opacity"] = "0";
Maybe this is the reason why its a bad practice to set single ID to multiple elements… Thats why I used class with this code:
var x = document.getElementByClassName('foo').style["opacity"] = "0";
But I see no results, and when i looked at the console it says!
document.getElementByClassName(); is not a function!