<button onclick="myFunction()">Try it</button>
<div id="myDIV" class="mystyle">
This is a DIV element.
</div>
<script>
function myFunction() {
var element = document.getElementById("myDIV");
// element.classList.toggle("mystyle2");
element.classList.remove("mystyle2");
element.classList.add("mystyle");
};
</script>