Is using the same id multiple times on a page bad practice even when I am not parsing through the page?

后端 未结 4 1728
广开言路
广开言路 2021-01-18 01:36

I understand that using the same id multiple times in a page creates malformed html. When using a jquery selector only the first element with the id will be returned, but in

4条回答
  •  梦谈多话
    2021-01-18 02:22

    http://www.w3.org/TR/WCAG20-TECHS/H93.html

    http://www.w3.org/TR/html401/struct/global.html#adef-id

    There are other things that read your HTML document, not just browsers.

    According to the HTML specification, the id attribute MUST be unique on a page (it's not a criteria web designers/developers just invented)

提交回复
热议问题