<!DOCTYPE html>
<html>
<style>
.example {
color: red;
width: 150px;
font-size: 20px;
}
</style>
<body>
<h1>HTML DOM Attributes</h1>
<h2>The length Property</h2>
<button id="myBtn" onclick="myFunction()" class="example">Try it</button>
<p>The attributes of the button above is:</p>
<p id="demo"></p>
<script>
let text = "";
const nodeMap = document.getElementById("myBtn").attributes;
for (let i = 0; i < nodeMap.length; i++) {
text += nodeMap[i].name + "<br>";
}
document.getElementById("demo").innerHTML = text;
function myFunction() {}
</script>
</body>
</html>