Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 860 Bytes

File metadata and controls

24 lines (18 loc) · 860 Bytes

External Link

npm version Build Status Coverage Status MIT Licensed

A simple function that tells you whether a link DOM node is 'external'.

A link is external if it:

  • has the attribute rel="external"
  • has the attribute target="_blank"
  • is an absolute link
  • is a telephone link
  • is a mailto link

To use

var external = require('external-link');
var link = document.querySelector('a');

external(link);