Is ASP.NET MVC the new "unobtrusive" JavaScript to render my HTML code invalid?

In the past few months, I read several articles about this new unobtrusive JavaScript approach in ASP.NET MVC. You can read about it here.

It basically puts all the HTML attributes with a prefix data-..., and the last time I checked, the HTML specification didn't allow such things. (I don't care about HTML 5 as it is not complete yet.)

My question is this:
If I use this function in my ASP.NET MVC application, this will invalidate the HTML output of the application, right? If so, what good is he doing?

It never bothered me that MVC puts a few JavaScript things here and there. But if my HTML output is invalid, it bothers me a lot.

+3
source share
1 answer

Yes, if you do not accept HTML5 as valid HTML, then it really will be "invalid." data-*Attributes are new features in the HTML5 specification.

, ; , , - CSS3 - , <canvas />, ! Heck, innerHTML JavaScript, - DOM, , HTML5!

+3

Source: https://habr.com/ru/post/1774486/


All Articles