Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The title attribute is not accessible, so its use is generally discouraged as an accessible label because screen readers can't pick it up (it's fine to use if you combine it with aria-label). Also, you can only show text in a title attribute, so the Popover API would allow you to add rich content to a tooltip (for better or worse :))

Edit: Remove extra "if"



Why "can't" (won't) screen readers pick up the title attribute?


They do pick up the "title" attribute sometimes and apply it as a label. But it's not really the same as being able to keyboard navigate to the browser-generated tooltip.


Not just screen readers. Basically no support for anyone not using a mouse to navigate. Also really annoying when people put link text in a title on links.


> The title attribute is not accessible

That's incorrect. There's nothing inherently inaccessible about the title attribute.

Voiceover, for example, reads the content of title attributes.

There are a bunch of reasons why title is pretty useless (the main one being it does nothing on every touch screen interface, where the concept of hover doesn't exist). But accessibility is not one of them.


> That's incorrect. There's nothing inherently inaccessible about the title attribute.

I think we might be splitting hairs here. There are accessibility concerns with the title attribute. MDN describes why the title attribute is problematic from an accessibility perspective [1] and provides a list of links with additional details. That MDN page also indicates that the title attribute is problematic for:

- People using touch-only devices

- People navigating with keyboards

- People navigating with assistive technology such as screen readers or magnifiers

- People experiencing fine motor control impairment

- People with cognitive concerns

That's a non-trivial amount of web users. So is it technically accessible? Yes. But if you want to deliver an accessible experience to everyone, and the title attribute is going to cause issues, I personally would define that as not being accessible.

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...

Edit: Formatting





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: