In general, the question in the title

Whether user attributes without data- prefix will affect the operation

  • what should attributes affect the work? - Grundy
  • On compatibility - ishidex2
  • compatibility with what? - Grundy
  • 3
    browsers are very tolerant to invalid html, so what they don’t like they usually just skip - Grundy
  • one
    All browsers known to me support arbitrary attributes, including data- - andreymal

1 answer 1

No, they will not. The HTML 5 specification does not imply any attribute names on the elements. The only difference is that your attributes without data- will not automatically fall into the dataset element. Those. the data-xxx type attribute applied to the elem element will be available via the DOM in the form of elem.dataset.xxx , for more details on MDN .

  • one
    “The HTML5 specification does not provide any restrictions” - well, it’s not true, " the future. ” - andreymal
  • What does dataset mean? - ishidex2
  • @Duoxx see the amended answer. - Petr Abdulin