You are here


Accessibility: where to put the search role when your search form is hidden

I've worked on several sites recently where the site search form is hidden by default and displayed by activating a button. This pattern caused me a bit of confusion about where to put the role="search" attribute, which is important for accessibility.

According to the W3C specification the search role is:

A landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility.