Accessible Text Link Generator – ARIA Links

Category: Javascript , Text | April 16, 2017
Author: scottaohara
Views Total: 362
Official Page: Go to website
Last Update: April 16, 2017
License: MIT

Preview:

Accessible Text Link Generator – ARIA Links

Description:

The small ARIA Links JavaScript library allows you to create text links using HTML data attribute rather than <a> tag. It also has the ability to display the link’s URL if JavaScript is unavailable.

How to use it:

Place the ARIA Links’ script at the end of the html document.

<script src="aria.links.js"></script>

Create links using html data attributes instead of <a> tag.

<span data-action="aria-link"
  data-href="https://www.google.com">
  Google
</span>

<span data-action="aria-link">
  Google
  <span data-link>
    https://www.google.com
  </span>
</span>

If you’d like to open the link in a new window/tab.

<span data-action="aria-link"
  data-href="https://www.google.com"
  data-blank>
  Google
</span>