Is it possible to change the CSS class of an HTML button using JavaScript?
I tried this but it didn't work:
document.getElementById("btnChoice1").setAttribute("class", "redButton");
HTML Button
<button class="basicButton" id="btnChoice1">
CSS
.basicButton {
width:300px;
}
.redButton {
width:300px;
background-color:red;
}