Last active
January 2, 2020 07:26
-
-
Save jkphl/633f49f478d7f3395de5 to your computer and use it in GitHub Desktop.
Use this JavaScript bookmarklet to find invalid anchor references within your HTML documents. The script searches the current document for links referring to named anchors on the same page that don't really exist and highlights them with a red background.
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
javascript:(function(){for(var a=0,anchors=document.querySelectorAll("a[href^='#']"),al=anchors.length,anchor;al>a;++a)anchor=anchors[a].href.split("#").pop(),anchor.length&&!document.getElementById(anchor)&&(anchors[a].style.color="#fff",anchors[a].style.backgroundColor="#f00")})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment