I think it’s not invalid in HTML 4 because of the weird loophole where you can always add an attribute to an HTML element.

I have mixed feelings about having this important info in an attribute rather than as element content, but users can’t see it and it seem like it would be valuable to them. But I guess you can just put it in the document for users as a separate thing that isn’t explicitly machine readable.