According to the HTML5 standard , custom attributes must begin with data-* . Nevertheless, in almost all even the official docks, for example for Anjular, the type code ng-model="" often given instead of data-ng-model="" .

Validators on countries with the attribute ng-model="" course swear, but there are no problems. Should I add a data-* prefix everywhere? Why do custom attributes have to start with this prefix?

  • In the case of an angular, there you can write both ng-model and data-ng-model . The parser will cut the part off the date itself. And, if you need to prevent validarot from swearing, you can add data to attribute names. - Moonvvell

1 answer 1

The main argument for validating HTML is to provide cross-browser compatibility. Each browser has its own parsing mechanisms, if chrome can swallow any code, then others may already have problems.

The main argument against validation is that it is too strict and does not correspond to the way browsers actually work.

If everything works for you, then you can write the code, as you prefer.