I am trying to change the font color of my div when a button is clicked using JavaScript. The two buttons I have are 'Green' and 'Red'.
<button type="button" class="green">Green</button>
<button type="button" class="red">Red</button>
Here is my div:
<div id="timer"></div>
Currently, the font color is red (default color). When 'Green' is clicked, it should turn green, and when 'Red' is clicked, it should go back to red.
It seems like a simple task, but for some reason, I can't seem to get it to work :)
If you have any insights on how to achieve this, I would greatly appreciate it.