Skip to content

Instantly share code, notes, and snippets.

@lap00zza
Created October 4, 2018 14:19
Show Gist options
  • Save lap00zza/4fe3edc955e6e6cfcbd2c8bd3002ba2c to your computer and use it in GitHub Desktop.
Save lap00zza/4fe3edc955e6e6cfcbd2c8bd3002ba2c to your computer and use it in GitHub Desktop.
Most websites don't add anchors to headings. Its important because you can bookmark it at that spot instead of scrolling all the way down. This bookmarklet helps solve that.
javascript:(document.querySelectorAll("h1[id],h2[id],h3[id],h4[id],h5[id],h6[id]").forEach(x => x.innerHTML = `<a href="#${x.id}">${x.innerHTML}</a>`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment