I'm creating thumbs up button with anchor tag when the user click on it, it background and font color change but the problem is it is changing the background color but not the font color:
function changeColor() {
document.getElementById('icon').style.color = "#fff"; // forecolor
document.getElementById('icon').style.background = "#008000"; // backcolor
}
.thumb-up {
border: 5px solid green;
width: 42%;
padding: 30px 6px 34px 32px;
border-radius: 100%;
}
<a onclick="changeColor()" href="#">
<div id="icon" class="thumb-up">
<i id="icon" class="fas fa-thumbs-up fa-5x"></i>
</div>
</a>
Problem: I want to change text and background color on click.

