WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Aria roles instead of headings?

for

From: Jared Smith
Date: Mar 4, 2013 8:58PM


On Mon, Mar 4, 2013 at 8:40 PM, Christian Biggins wrote:

> One problem is the markup of our search form. It usually sits above the
> page title (h1) and has been marked up incorrectly with an h2 for the
> search form title.

There's nothing wrong with having an h2 precede the h1.

> My question is, is it acceptable to wrap the form with a div containing the
> role 'search' or even give them 'form' tag the 'role' attribute of 'search'

Either (but not both) would be fine. You already have a form element,
so it'll be cleaner to just add the search role to it.

> rather than having a heading at all up there?

Why not do both? This would provide easier page navigation for users
that navigate by headings and those that navigate by landmarks.

Jared