Skip to content

Instantly share code, notes, and snippets.

@Riksi
Riksi / linkback.js
Created July 27, 2023 10:39
Script to link footnotes back to text in Paul Graham's essays
// Open the console and paste this code into it.
// Get all the text links to footnotes
const textLinks = document.querySelectorAll('a[href^="#f"]');
// Iterate over each text link
textLinks.forEach((link) => {
// Get the footnote number from the 'href' attribute of the text link
// f{num}n
let href=link.getAttribute('href')