DEV Community

Discussion on: The #1 Trick In Learning React That Separates Success From Failure

Collapse
johnhorner profile image
Info Comment hidden by post author - thread only visible in this permalink
John Horner

If we had an HTML element, say a div with an attribute called "title", this code would be invalid. HTML doesn't have a title attributes for any of its elements

Off topic but that's a very strange thing to say.

developer.mozilla.org/en-US/docs/W...

Collapse
reedbarger profile image
Reed Barger Author • Edited on

Ha! I'll change it to another example for the sake of accuracy, but be honest--you've never used the title attribute.

Collapse
justaashir profile image
Aashir Aamir Khan

<abbr> tag doesn't really work without title attribute

Collapse
johnhorner profile image
John Horner

To be honest, I've used it literally thousands of times, on links. Used on a link it provided a kind of tooltip—the equivalent of the alt attribute on images. However from HTML5 onward it's deprecated because of accessibility issues.

This article lays out the cases where it should and shouldn't be used:

developer.paciellogroup.com/blog/2...

but it's never been invalid HTML.

Some comments have been hidden by the post's author - find out more