Can multiple different HTML elements have the same ID if they're different elements?

后端 未结 16 1855
无人及你
无人及你 2020-11-21 05:30

Can multiple HTML elements have the same ID if they\'re of different element types? Is a scenario like this valid? Eg:

div#foo
span#foo
a#foo
16条回答
  •  感动是毒
    2020-11-21 05:47

    Is it possible to have more than one student in a class having same Roll/Id no? In HTMLid attribute is like so. You may use same class for them. e.g:

    And so on.

提交回复
热议问题