JSFiddle - React, Tailwind, and code Playground

by Increazon

JavaScript

function detectNoFollow(rel)
{
    var idx = rel.search('nofollow');
    if (idx != -1) return true;
    else return false;
}


alert(detectNoFollow('asd nofollow'));
alert(detectNoFollow('nofollow'));
alert(detectNoFollow('nofollow external'));
alert(detectNoFollow('external'));