xxxxxxxxxx
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
This is a DIV element.
</div>
.mystyle {
width: 100%;
padding: 25px;
background-color: coral;
color: white;
font-size: 25px;
}
function myFunction() {
var element = document.getElementById("myDIV");
element.classList.toggle("mystyle");
}