Question

This issue is about accessibility (508) compliance.

I have a link with a title attribute that shows up in a tool tip. Within that tool tip is the abbreviation "Dr." In order to have a screen reader say "doctor" instead of "dur", I have to wrap the abbreviation in an <abbr> tag like so in line two:

<a class="fancybox" href="#brenda-jones-harden" 
title="View <abbr title='Doctor'>Dr.</abbr> Brenda Jones Harden's bio">
<img src="https://content.cleverex.com/hslc/tta-system/ehsnrc/btt/images/no-photo.jpg" 
alt="No Photo Available" height="96" width="80"><span class="two_liner">
<abbr title='Doctor'>Dr.</abbr> Brenda Jones Harden</span></a>

However, when I use the abbr tag inside the title tag the pop-up tool tip reads:

"View <abbr title='Doctor'>Dr.</abbr> Brenda Jones Harden's bio"

I believe this means that I can't nest the abbr tag inside an alt or title attribute. Doing so will always have the tag showing as regular text. Do you agree? Is there a workaround? I can't find the answer to this anywhere, so I'm submitting my first-ever question to Stack Overflow. Please excuse me if I don't quite have the eloquence of most of your other posts.

Was it helpful?

Solution

Short answer: No, you can't nest a tag in an attribute. http://www.w3.org/TR/html5/dom.html#attr-title

I recommend writing just Doctor, as was already mentioned in the comments :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top