for (const link of document.links) {
const linkHref = document.createTextNode(link.href);
const lineBreak = document.createElement("br");
document.body.appendChild(linkHref);
document.body.appendChild(lineBreak);
}Document: links property / notebook
Document: links property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.