buttons數組怎么理解?
-----css代碼
#buttons { position: absolute; height: 10px; width: 100px; z-index: 2; bottom: 20px; left: 400px;}
? ? ? ? #buttons span { cursor: pointer; float: left; ?width: 10px; height: 10px; border-radius: 50%; background: #333; margin-right: 5px;}
-----html代碼
?<div id="buttons">
? ? ? ? <span index="1" class="on"></span>
? ? ? ? <span index="2"></span>
? ? ? ? <span index="3"></span>
? ? ? ? <span index="4"></span>
? ? ? ? <span index="5"></span>
? ? </div>
請問怎么 span中index 如何理解? 為什么buttons是一個數組 ?
2015-04-20
這里的index應該是自定義屬性,比如html5的data。getElementById('buttons').getElementsByTagName('span')這里返回的是多個標簽