Opening a link in a new window or tab

I tend to like opening links to external websites in a new window with target=_blank. Below is an example of the code I use to make a link like that more accessible. WCAG guidelines say we should warn a screen reader user when a link is going to open in a new window, so I do that with an aria-label attribute in the a tag. Using an aria-label attribute is a way to override the standard accessible name of the link and provide more context for screen reader users.

Example of a link with an aria-label attribute in the a tag


Videos can be hosted in MediaSite

Videos can be hosted in MediaSite

Actually, the best practice for links that open in a new window is to provide both visual and verbal indication. For sighted users an external link icon appended at the end of the link could be used. See this article about opening links in new windows article from the University of California Berkeley for more information about best practices. WCAG guidelines only recommend opening links in new windows in a few special situations.