I'm actually working on a darkmode and have a problem to change the css of more than one element.
JS code:
var elem = document.getElementById('fonts');
for(var i=0; i<elem.length; i++){
elem[i].style.color="#FFFFFF";
console.log(elem[i]);
}
But nothing changes.. i think i need to do it with the loop because i got more elements with the id "fonts". If i do it without the loop, than will only change the first one.
The console dont give an error or anything.. did i something wrong?