WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: "Go to Top" element, link or button

for

From: Srinivasu Chakravarthula
Date: Jan 17, 2023 10:53PM


Historically, we use "link" for Skip elements and "back to top" does
similar job hence it can be a link too and not a button.
Regards,

Srinivasu Chakravarthula, CPWA
Website <http://www.srinivasu.org>; | LinkedIn Profile
<http://linkedin.com/in/srinivasuc>; | Follow me on Twitter
<http://twitter.com/csrinivasu>;
Director of Accessibility, Freshworks


On Wed, Jan 18, 2023 at 5:22 AM Glen Walker < <EMAIL REMOVED> > wrote:

> Links are for navigating, whether to a new page or a different location on
> the same page, so it sounds like you should have a link.
>
> If the user can use the browser's “back“ button and navigate back to where
> they were before they selected the “go to top” element , then that's
> another argument that it should be a link.
>
> But I can understand if someone argues for a button since this feels like
> an immediate action.
>
> For me, it comes down to how it's implemented. If you make it a button and
> then you programmatically move the focus to the top of the section, then
> the user can't use the browser's back button and it would be OK to be a
> button instead of a link.
>
> My first choice would be a link and use the browser's built-in
> functionality to move the focus for you. But I wouldn't fail WCAG if a
> button was used and implemented as mentioned above.
> > > > >