1

When people ask about HTML attributes, they mostly mean the value of an HTML attribute. I am actually asking about real attributes.

Is the following valid?

<a href="test.html" data-attribute-with-&amp;-character="hello">world</a>

Until which degree are attribute names valid (multibyte for example)?

Daniel W.
  • 31,164
  • 13
  • 93
  • 151

1 Answers1

2

Have a look at the HTML standard: https://html.spec.whatwg.org/multipage/syntax.html#attributes-2

They must

consist of one or more characters other than controls, U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=), and noncharacters

Please see this answer.

vgar
  • 171
  • 6