This page is outdated

You are reading documentation for Linkify v2. Browse the latest v3+ documentation.

Jump To

Linkify jQuery Interface

linkify-jquery is an provides the Linkify jQuery plugin. This functionality is also available in vanilla JavaScript via linkify-element.

Installation

Node.js/Browserify

npm install linkifyjs
var $ = require('jquery');
require('linkifyjs/jquery')($, document);

or with ES6 modules

import $ from 'jquery';
import linkifyJq from 'linkifyjs/jquery';
linkifyJq($, document);

Where the second argument is your window.document implementation (not required for Browserify).

AMD

Note that linkify-jquery requires a jquery module.

<script src="jquery.amd.js"></script>
<script src="linkify.amd.js"></script>
<script src="linkify-jquery.amd.js"></script>
require(['jquery'], function ($) {
  // …
});

Browser globals

<script src="jquery.js"></script>
<script src="linkify.js"></script>
<script src="linkify-jquery.js"></script>

Usage

var options = { /* … */ };
$(selector).linkify(options);

Params

See all available options.

DOM Data API

The jQuery plugin also provides a DOM data/HTML API - no extra JavaScript required!

<!-- Find and linkify all entities in this div -->
<div data-linkify="this"></div>

<!-- Find and linkify the paragraphs and `#footer` element in the body -->
<body data-linkify="p, #footer" data-linkify-target="_parent"></body>

Additional data options are available.