<html>
<style>
.class1 {background-color:red;width:50px;height:50px}
.class2 {background-color:blue;width:50px;height:50px}
</style>
<body>
<h1>HTML DOM Attributes</h1>
<h2>The value() Property</h2>
<div id="myDiv" class="class1"></div>
<p>Click to change the value of the second attribute:</p>
<button onclick="myFunction()">Click Me</button>
<script>
function myFunction() {
document.getElementById("myDiv").attributes[1].value = "class2";
}
</script>
</body>
</html>