document.getElementById can't select more than one element

前端 未结 4 1216
暗喜
暗喜 2021-01-29 14:01

I\'m working on loading. I have div #loading which is visible. And more divs #message which are hidden. I have js function.

function lo         


        
4条回答
  •  野的像风
    2021-01-29 14:22

    ID attribute must be unique. You can't use same ID multiple times on the page. If you like to use same key then use it as a class or data-id which can be same or differ.

提交回复
热议问题