<html>
<style>
.mystyle {
background-color: coral;
padding: 16px;
}
</style>
<body>
<h1>The Element Object</h1>
<h2>The className Property</h2>
<div id="myDIV">
<p>I am myDIV.</p>
</div>
<p>Click the button to set a class for myDIV:</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("myDIV").className = "mystyle";
}
</script>
</body>
</html>