<!DOCTYPE html>
<html>
<style>
.myStyle {
background-color: coral;
padding: 16px;
}
.newStyle {
background-color: lightblue;
text-align: center;
font-size: 25px;
padding: 16px;
}
</style>
<body>
<h1>The Element Object</h1>
<h2>The className Property</h2>
<button onclick="myFunction()">Change</button>
<p>Click "Change" the change the class attribute of "myDIV" to "newStyle".</p>
<div id="myDIV" class="myStyle">
<p>I am myDIV.</p>
</div>
<script>
function myFunction() {
document.getElementById("myDIV").className = "newStyle";
}
</script>
</body>
</html>