<html>
<style>
.example {
color: red;
width: 150px;
font-size: 20px;
}
</style>
<body>
<h1>HTML DOM Attributes</h1>
<h2>The length() Property</h2>
<button id="myButton" onclick="myFunction()" class="example">Try it</button>
<p>How many attributes has the button above?</p>
<p id="demo"></p>
<script>
let num = document.getElementById("myButton").attributes.length;
document.getElementById("demo").innerHTML = num;
function myFunction() {}
</script>
</body>
</html>