I need to create a button to change my li's to black.
html
<h2>Sonnenfarben</h2>
<div class="box">
<ul type="circle" class="liste2">
<li class="farbeRot">rot</li>
<li class="farbeOrange">orange</li>
<li class="farbeGelb">gelb</li>
</ul>
<button onclick="changeColor()">Lights out</button>
<ol class="liste3" start="3">
<li class="farbeBraun">braun</li>
<li class="farbeGrau">grau</li>
</ol>
css
.farbeRot{
color: ;
font-weight: bold;
}
.farbeOrange{
color: orange;
font-style: italic;
}
.farbeGelb{
color: yellow;
}
.farbeBraun{
color: brown;
font-style: italic;
}
.farbeGrau{
color: grey;
font-weight: bold;
}
.box{
color: black;
}
JS
function changeColor(){
document.querySelector('.box').style.color = "black";
}
Tried to connect everything but didn´t work out.
edit: put in all colors I defined already. Tried deleting them etc. but it still did not work.