I'm creating an alert page that has the user click a button to see if an alert is seen or not. In my code I have the button changing text but not color how do I get the button to change color when I click on it.
document.getElementById("seen").addEventListener(
"click",
function(event) {
if (event.target.value === "unacknowledged") {
event.target.value = "acknowledge";
} else {
event.target.value = "unacknowledged";
}
},
false
);
#seen {
background-color: #1da4f1;
border: none;
border-radius: 4px;
color: white;
padding: 2px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
}
<input type="button" id="seen" value="unacknowledged">