WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: title attribute of anchor tag

for

Number of posts in this thread: 11 (In chronological order)

From: Lee, Samson (NIH/NIDCR)
Date: Wed, Feb 18 2004 3:20PM
Subject: title attribute of anchor tag
No previous message | Next message →

I have an anchor tag that has a javascript function that swaps a particular
image when it's mouse-overed to provide extra information. For the 508
compliancy, I added the equivalent info in its title attribute. I think this
satisfies the requirement but wanted to make sure. Here's the code:

<a onMouseover="swapImage('defaultImageID','','extraInfoImage.gif',1)"
onMouseout=swapImgRestore()
href="page.htm" title="extra info about the link" >Some Link</a>

When I test this, JAWS reads the value of the title attribute ("extra info
about the link"), but Home Page Reader reads the link name ("Some link"). Is
this a right way to do it?


----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/


From: Paul Bohman
Date: Thu, Feb 19 2004 9:05AM
Subject: Re: title attribute of anchor tag
← Previous message | Next message →

If you are swapping images, wouldn't you want to provide the extra info
in the alt text, rather than the title? (or are you swapping images
somewhere else on the page, and not at the link itself? e.g. is your
link really text, or is it an image?)



Lee, Samson (NIH/NIDCR) wrote:
> I have an anchor tag that has a javascript function that swaps a particular
> image when it's mouse-overed to provide extra information. For the 508
> compliancy, I added the equivalent info in its title attribute. I think this
> satisfies the requirement but wanted to make sure. Here's the code:
>
> <a onMouseover="swapImage('defaultImageID','','extraInfoImage.gif',1)"
> onMouseout=swapImgRestore()
> href="page.htm" title="extra info about the link" >Some Link</a>
>
> When I test this, JAWS reads the value of the title attribute ("extra info
> about the link"), but Home Page Reader reads the link name ("Some link"). Is
> this a right way to do it?


--
Paul Ryan Bohman
Web Accessibility Specialist/Project Coordinator
WebAIM (Web Accessibility in Mind)
www.webaim.org
Center for Persons with Disabilities
www.cpd.usu.edu
Utah State University
www.usu.edu



----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/


From: Lee, Samson (NIH/NIDCR)
Date: Thu, Feb 19 2004 9:24AM
Subject: RE: title attribute of anchor tag
← Previous message | Next message →

Yes, I'm swapping images somewhere else on the page and the link itself is
text.

From: julian.rickards
Date: Thu, Feb 19 2004 9:46AM
Subject: RE: title attribute of anchor tag
← Previous message | Next message →

If I understand this correctly, you have a link, for example on the left
side, and when the mouse rolls over the link, a graphic changes, say perhaps
on the right side. The graphic provides additional information which you
want all users to have access to.

I don't have much experience with JAWS but I don't think JAWS users will get
the additional information because of the separation between the link and
the graphic. If this is the case, I don't think you should use it or at
least not depend on it - what if a user disabled JavaScript, what are they
missing? Critical information or just a little icing on the cake?

---------------------------------------------------------
Julian Rickards
Digital Publications Distribution Coordinator
Publications Services Section
Ontario Ministry of Northern Development and Mines
Phone: (705) 670-5608
Fax: (705) 670-5690


>

From: Paul Bohman
Date: Thu, Feb 19 2004 10:30AM
Subject: Re: title attribute of anchor tag
← Previous message | Next message →

As far as the title attribute is concerned, Home Page Reader 3.02 (and
greater) can access the title attribute by pressing CTRL + SHIFT + F1.
Unfortunately, I don't know of any way that HPR can be set to just
simply read the title on links (does anyone else know?). The keyboard
combination mentioned above is definitely unfriendly.

Also, I didn't realize it, but I had been using an outdated version of
HPR on my own computer. I had version 3.002. The current version is
3.021. That would explain why I wasn't able to hear the title attribute
no matter what I did, until I upgraded my HPR. If there are HPR users
out there, they may or may not have the latest version. (Free HPR update
available at
http://www-306.ibm.com/able/solution_offerings/hpr3upgrade.html for
current HPR 3.0 users)

Still, most people who need screen readers don't use HPR. Most use
either JAWS or Window Eyes, or some other full-featured program. Home
Page Reader only reads Web pages, email, and a few Web-specific programs.

With that in mind, the title attribute will probably be sufficient for
most of your users. However, to guarantee that all users can access the
extra information, you might have to resort to some sort of a hack.
Possibilities include:

1. making the link an image, so that you can use the alt attribute
2. using CSS to place the extra text above the visible area on the page
(explained below)
3. inserting a 1px by 1px image after the text link and putting the alt
text there

None of these are ideal, and you may decide to stick with the title
attribute, but these are at least options to consider. If anyone else
has any better ideas, let me know.



Code for option 2:

In the style sheet:

.hide-text
{
position: absolute;
left: 0px;
top:-100px;
}

In the XHTML:

<a href="whatever.htm">Link text <span class="hide-text">this text
further explains the link text</span></a>

End result: the explanatory text is placed 100 pixels above the top of
the page, thus rendering it "invisible," but it is still read in context
by all screen readers, and the text is visible (and in the correct
context) when style sheets are turned off. It's a hack, but it works.


Lee, Samson (NIH/NIDCR) wrote:

> Yes, I'm swapping images somewhere else on the page and the link itself is
> text.
>


--
Paul Ryan Bohman
Web Accessibility Specialist/Project Coordinator
WebAIM (Web Accessibility in Mind)
www.webaim.org
Center for Persons with Disabilities
www.cpd.usu.edu
Utah State University
www.usu.edu




----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/


From: Lee, Samson (NIH/NIDCR)
Date: Thu, Feb 19 2004 11:26AM
Subject: RE: title attribute of anchor tag
← Previous message | Next message →

Your CSS trick is pretty neat. The reason why I have this thing going is
that I don't have enough space in the text link area, so I'm calling the
links like Figure 1, Figure 2, and etc., and when you mouse over these links
javascript brings up their associated images on the other part of the page
to give titles/descriptions of those figures. Initially I was happy to hear
JAWS reading the anchor tags' title attribute values, but now I'm thinking
that's not good enough since it is ignoring the words of actual text links
(hence it's not providing the equivalent information). Anyway I'll probably
go with the second option... I can't think of anything better than that.
Thank you!

From: Andrew Kirkpatrick
Date: Fri, Feb 20 2004 8:09AM
Subject: RE: title attribute of anchor tag
← Previous message | Next message →

> 1. making the link an image, so that you can use the alt
> attribute 2. using CSS to place the extra text above the
> visible area on the page (explained below) 3. inserting a 1px
> by 1px image after the text link and putting the alt text there

Lee,
The one downside of option 2 (moving the extra text off screen) is that it
will not work for users browsing with images off or with a client that
doesn't support images (but does support CSS).

An additonal thing to think about is adding onfocus and onblur attributes to
the link so the the rollover will work for keyboard users also.

<a onMouseover="swapImage('defaultImageID','','extraInfoImage.gif',1)"
onMouseout=swapImgRestore()
onfocus="swapImage('defaultImageID','','extraInfoImage.gif',1)"
onblur=swapImgRestore() href="page.htm" title="extra info about the link"
>Some Link</a>

AWK




----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/


From: Lee, Samson (NIH/NIDCR)
Date: Fri, Feb 20 2004 8:21AM
Subject: RE: title attribute of anchor tag
← Previous message | Next message →

Thanks for pointing that out. But I think I just found a better solution. I
can just go title="Some Link: extra info about the link", so this way JAWS
will read the both link itself and its extra info... (duh!)

From: Andrew Kirkpatrick
Date: Fri, Feb 20 2004 9:47AM
Subject: RE: title attribute of anchor tag
← Previous message | Next message →

Be careful. You might have heard that this is true, and it is, as long as
the user's preference is set to read titles on links. In JAWS you can set
it to read one of three things:
A) screen text
B) title attribute
C) longest (of the title and the screen text)

I believe that the setting is "screen text" by default.

AWK

>

From: Paul Bohman
Date: Fri, Feb 20 2004 10:14AM
Subject: Re: title attribute of anchor tag
← Previous message | Next message →

Other screen readers don't automatically read the title attribute
either. As was mentioned before, Home Page Reader only reads the title
with an obscure keyboard shortcut. I tested briefly with Window Eyes,
and couldn't get it to read the title, but I admit that I'm not an
expert Window Eyes user. If anyone out there knows more about how Window
Eyes reads the title attribute, I'd appreciate hearing about it.

The option of using CSS to place the text off screen, combined with
Andrew's suggestion to use onfocus and onblur, still seems like a more
universal workaround to your particular dilemma.

Andrew Kirkpatrick wrote:
> Be careful. You might have heard that this is true, and it is, as long as
> the user's preference is set to read titles on links. In JAWS you can set
> it to read one of three things:
> A) screen text
> B) title attribute
> C) longest (of the title and the screen text)
>
> I believe that the setting is "screen text" by default.
>
> AWK
>
--
Paul Ryan Bohman
Web Accessibility Specialist/Project Coordinator
WebAIM (Web Accessibility in Mind)
www.webaim.org
Center for Persons with Disabilities
www.cpd.usu.edu
Utah State University
www.usu.edu



----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/


From: Jim Thatcher
Date: Fri, Feb 20 2004 6:56PM
Subject: RE: title attribute of anchor tag
← Previous message | No next message

Hi all,

Window-Eyes doesn't read the title attribute on the link - as far as I can
determine. Reading this discussion is amusing - the problem described seems
similar the one that got a government agency (agency's web developer) in hot
water (from my perspective) as documented in
http://jimthatcher.com/whatnot.htm.

It would be helpful to see the site (page) but, in my opinion, if the "extra
information" is readily available when you get to the link, it would be
better just to leave things alone - without jumping through hoops of
invisible gifs and extra alt text.

Jim
Accessibility, What Not to do: http://jimthatcher.com/whatnot.htm.
Web Accessibility Tutorial: http://jimthatcher.com/webcourse1.htm.