Skip to main content
Home / Code Snippets / jQuery Code Snippets / Find all Internal Links

Find all Internal Links

Find all links that start with the sites domain, a slash, relative file path, or a hashtag.

var siteURL = "http://" + top.location.host.toString();

var $internalLinks = $("a[href^='"+siteURL+"'], a[href^='/'], a[href^='./'], a[href^='../'], a[href^='#']");
icon-link icon-logo-star icon-search icon-star