Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
Jessica_C

Making search icon (magnifying glass) accessible?

Question

Posted (edited)

There's no alt text or other label associated with the search icon, so screen reader software (I tested with NVDA) announces it as 'button'. Can anyone please help me figure out how to add in alt text - or similar, I'm open to other options - so that screen reader users can find and use the search tool on my site?

(I want to avoid using one of the search style options that adds the word search on the screen - it not only dwarfs the rest of our navigation, but search appears to be placeholder text, so that wouldn't really resolve the screen reader issue.)

Edited by Jessica_C
Initial Revision

Share this post


Link to post

8 answers to this question

Recommended Posts

  • 0

Try adding this to Settings > Advanced > Code Injection > Footer:


window.Squarespace.onInitialize(Y, function(){
 document.querySelector(".Header-search-form-submit").setAttribute('aria-label', 'Search');
});

Let me know how you get on.

-Paul

Squarespace Expert & Professional Developer

Contributors to this forum voluntarily give their time to help you. If we correctly answer your question, please accept the answer by clicking Accept below it (you'll see it when you're logged on). If an answer doesn't help, feel free to ask for more help or wait for other forum users to add their comments and/or answers.

Whenever an accepted answer helps you, please vote it up using the up arrow on the right. This helps other forum users by giving them confidence in an answer.


If a response has helped you, please give thanks using the  like-20-mag.png.3997345d620e40b4760b5d7a667cad54.png button.
Need personalised help? I'm a professional Developer who works with Designers internationally. You can book me via my company's website. www.sf.digital

Share this post


Link to post
  • 0

Thanks for the code... I pasted exactly that into the code injection > footer, and it looks solid, but it's not working. It's still only announcing as button.

Share this post


Link to post
  • 0

Is it installed? I don't see the code on your site, and so the button reads as "button".

When I manually add the code to your site, my screenreader reads "search".


If a response has helped you, please give thanks using the  like-20-mag.png.3997345d620e40b4760b5d7a667cad54.png button.
Need personalised help? I'm a professional Developer who works with Designers internationally. You can book me via my company's website. www.sf.digital

Share this post


Link to post
Guest
This topic is now closed to further replies.

×
×
  • Create New...