<html>
<body>
<h1>HTML DOM 属性</h1>
<h2>length 属性</h2>
<button id="myButton" onclick="myFunction()">试一试</button>
<p>按钮的第二个属性 (index 1) 是:</p>
<p id="demo"></p>
<script>
let attr = document.getElementById("myButton").attributes[1].name;
document.getElementById("demo").innerHTML = attr;
function myFunction() {}
</script>
</body>
</html>