Created
November 24, 2014 07:00
-
-
Save m8rge/a8dfa2e40ac396be12da to your computer and use it in GitHub Desktop.
Validate on page anchors consistence on github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
$('article').find('a:not(.anchor)[href^=#]').each(function (i, e) { | |
var id = $(e).attr('href').replace(/^#/, ''); | |
if ($('a[id="' + decodeURI(id) + '"]').length == 0) { | |
console.log(e); | |
} else { | |
console.log('validated'); | |
} | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment