[whatwg] Custom attributes [was: Adding a src attribute to all elements]

On Wed, Nov 4, 2009 at 5:57 AM, Markus Ernst <derernst at gmx.ch> wrote:
> While experimenting with the validator (at validator.w3.org), I found that
> it does actually not complain about <h1 src="whatever.gif">. Thus, Tab's
> example would be perfectly valid. The validator even seems to accept any
> custom attribute name on any element - this is said to be valid HTML5:
>
> . . .
>
> Is this a mistake in the validator, due to its experimental state, or is
> there something missing in the spec?

A mistake in the validator.  http://validator.nu/ gives the correct
answer: it's invalid.  You need to prefix custom attributes with
"data-".

Received on Wednesday, 4 November 2009 06:25:58 UTC