# DOM Manipulation Turn all links on a page to Wikipedia style citations ```javascript= document.querySelectorAll('a[href]').forEach((a, i) => { // Create the footnote marker const fn = document.createElement('sup') fn.innerHTML = `[<a href="${a.href}">${i + 1}</a>]` // Insert it after the link a.parentElement.insertBefore(fn, a.nextSibling) // Create a span and copy the link's content into it. const span = document.createElement('span') while (a.hasChildNodes()) { span.appendChild(a.firstChild) } // Replace the link with the span. a.parentElement.replaceChild(span, a) }) ```