x-link

1.2.1 • Public • Published

X-Link will grab any links it finds within a given container.

If the href attribute points to a host that is not the same as the current host, it's target attribute will be set to _blank i.e. new window / tab (depending on browser behaviour).

Elements which already have a target attribute will be ignored.

Installation

npm install x-link

Usage

var XLink = require("x-link");

// Grab all links on page
XLink.init();

// Grab only links on within "#my-links"
var el = document.getElementById("my-links");
XLink.init(el);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.10latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.10
1.2.00
1.1.23330
1.1.220
1.1.10
1.1.00
1.0.110
1.0.100
1.0.90
1.0.81
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i x-link

Weekly Downloads

1

Version

1.2.1

License

ISC

Unpacked Size

4.56 kB

Total Files

4

Last publish

Collaborators

  • ollybollix