WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: "<label>" for search field

for

From: Jared Smith
Date: May 17, 2010 2:18PM


On Mon, May 17, 2010 at 12:50 PM, Langum, Michael J wrote:
> What is the groups thinking on the adequacy of relying solely on "title" attributes to give a prompt for the standard site search field?

It is supported by all modern screen readers. There isn't anything
that requires or specifies that screen readers should read the title
attribute for form elements that are missing labels, but they all do.

I, personally, am a bit uncomfortable with this approach. According to
the HTML specification, the title attribute is for "advisory
information" - and if something is inaccessible without the title
value, this certainly seems to suggest that this information is more
than advisory.

I think a better approach is to provide a <label> in markup, but
position it off-screen with CSS
(http://webaim.org/techniques/css/invisiblecontent/).

You might also consider changing the button text of "Go" to something
more descriptive such as "Search" or "Submit Search".

Jared Smith
WebAIM