Detecting data attributes


show more Detecting data attributes provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Enhancing the DOM show less
please wait ...

Detecting data attributes

In an HTML document, a developer can type in any attributes, even if they don't necessarily exist and pretend they're valid HTML. The browsers usually ignore them, but validaters will flag these as not being normal HTML. This is the HTML for the document we've been working with. And if I want to, I can add a coolness attribute here and set it to whatever I want. Now, the browser is probably going to ignore this attribute and not do anything with it, but if I try to validate my document. I want to copy this and I'll switch over to the WC3 validater.

And I'll click on the Validate By Direct Input tab, and paste my code right there. And I'll hit the Check button, you could see that it's telling me that there's at least one error there. Let me scroll all the way to the bottom, and notice that it says attribute coolness not allowed on element image at this point. It really means that it doesn't know anything about this new attribute that I j...

Detecting data attributes
Video duration: 3m 29s 2h 3m Intermediate

Viewers:

Detecting data attributes provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Enhancing the DOM

Subjects:
Developer Web
Software:
HTML JavaScript
Author:
please wait ...